Giter Site home page Giter Site logo

How to add Toolbar in xml ? about scrollable HOT 5 CLOSED

noties avatar noties commented on June 8, 2024
How to add Toolbar in xml ?

from scrollable.

Comments (5)

xu6148152 avatar xu6148152 commented on June 8, 2024

are you kiding us...

from scrollable.

leelei avatar leelei commented on June 8, 2024

i need this effect
needed

if use

<style name="AppTheme.Base" parent="Theme.AppCompat">

it can work ,but i do not want use like that, i use

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">

but it does not work well

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:psts="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
  <ru.noties.scrollable.ScrollableLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:psts="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/scrollable_layout"
      app:scrollable_maxScroll="@dimen/user_profile_cover">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

      <RelativeLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:id="@+id/layout_profile_header"
          android:layout_width="match_parent"
          android:layout_height="@dimen/user_profile_cover"
          >

        <ImageView
            android:id="@+id/imageView_user_profile_cover"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_above="@+id/textView_user_screenname"
            android:scaleType="centerCrop"
            android:src="@color/primary"
            />

        <include
            android:id="@+id/imageView_portrait"
            android:layout_width="@dimen/avatar_large_size"
            android:layout_height="@dimen/avatar_large_size"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="88dp"
            layout="@layout/layout_avatar"
            />

        <TextView
            android:id="@+id/textView_userverified_reason"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/imageView_portrait"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="@dimen/spacing_normal"
            android:layout_marginLeft="40dp"
            android:layout_marginRight="@dimen/spacing_huge"
            android:layout_marginBottom="@dimen/spacing_small"
            android:textSize="16sp"
            android:singleLine="true"
            android:marqueeRepeatLimit="marquee_forever"
            android:ellipsize="marquee"
            style="@style/TextViewBody1"
            tools:text="马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇不马薇薇不算是昵马薇薇薇薇不"
            />

        <TextView
            android:id="@+id/textView_user_screenname"
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:paddingLeft="@dimen/spacing_large"
            android:paddingRight="@dimen/spacing_large"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:gravity="center_vertical"
            style="@style/TextViewSubhead"
            android:textSize="18sp"
            android:textColor="@color/white"
            tools:text="马薇薇不算是昵称吧马薇薇不算"
            android:background="@color/white"
            />
      </RelativeLayout>


      <com.astuetz.PagerSlidingTabStrip
          android:id="@+id/tabs"
          android:layout_below="@id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="@dimen/tab_strip_height"
          android:background="@color/white"
          psts:pstsShouldExpand="true"
          psts:pstsIndicatorColor="@color/white"
          android:textColor="@color/white"
          psts:pstsTextColorSelected="@color/white"
          />

      <ImageView
          android:id="@+id/fab_button"
          android:layout_width="@dimen/fab_size"
          android:layout_height="@dimen/fab_size"
          android:layout_marginTop="-116dp"
          android:background="@drawable/fab_button_teal"
          android:elevation="@dimen/elevation_normal"
          android:scaleType="centerInside"
          android:visibility="visible"
          android:layout_gravity="right"
          android:layout_marginRight="@dimen/spacing_normal"
          />

    </LinearLayout>

    <android.support.v4.view.ViewPager
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/tab_strip_height"
        android:id="@+id/view_pager"/>

  </ru.noties.scrollable.ScrollableLayout>

  <android.support.v7.widget.Toolbar
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/toolbar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/fab_material_deep_purple_900"
      />
</FrameLayout>

Image

from scrollable.

noties avatar noties commented on June 8, 2024

Hi!
The reason is behind the theme you are using Theme.AppCompat.Light.NoActionBar. It obviously states that theme does not have an action bar (aka toolbar). Why won't you use simple Theme.AppCompat.Light?

from scrollable.

noties avatar noties commented on June 8, 2024

Plus,
include Toobar into your header (it's the @+id/layout_profile_header ViewGroup) and implement your sticky behavior in ScrollableLayout.setOnScrollChangedListener(). Please refer to the sample app for the concrete implementation.

from scrollable.

noties avatar noties commented on June 8, 2024

ping
Is your problem solved?

from scrollable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.