2016-10-01 55 views
-5
<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/todoDetailsCoordinatorLayout" 
    android:background="@color/windowBackground" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <RelativeLayout 
     android:id="@+id/todoEditMainLl" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/windowBackground" 
     android:orientation="vertical"> 

     <android.support.design.widget.AppBarLayout 
      android:id="@+id/todoDetailsAppBar" 
      android:layout_width="match_parent" 
      android:layout_height="@dimen/toolbar_height" 
      android:theme="@style/AppTheme.AppBarOverlay"> 

      <android.support.v7.widget.Toolbar 
       android:id="@+id/todoDetailsToolbar" 
       android:layout_width="match_parent" 
       android:layout_height="?attr/actionBarSize" 
       android:background="?attr/colorPrimary" 
       app:contentInsetStart="10dp" 
       app:popupTheme="@style/AppTheme.PopupOverlay" /> 

     </android.support.design.widget.AppBarLayout> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_above="@+id/todoDetailsBottomLl" 
      android:layout_below="@+id/todoDetailsAppBar" 
      android:orientation="vertical"> 

      <android.support.v4.widget.NestedScrollView 
       android:id="@+id/todoDetailsScrollView" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent"> 


       <LinearLayout 
        android:id="@+id/todoEditTopLl" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:background="@color/windowBackground" 
        android:orientation="vertical" 
        android:visibility="visible"> 

        <android.support.v7.widget.CardView 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:paddingTop="@dimen/eight_dp"> 

         <LinearLayout 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:orientation="vertical" 
          android:paddingLeft="@dimen/activity_vertical_margin" 
          android:paddingRight="@dimen/activity_vertical_margin"> 


          <RelativeLayout 
           android:layout_width="match_parent" 
           android:layout_height="@dimen/list_item_single_line_height" 
           android:gravity="center_vertical" 
           android:orientation="horizontal"> 

           <LinearLayout 
            android:layout_width="@dimen/avatar_icon_touch_area_size" 
            android:layout_height="@dimen/avatar_icon_touch_area_size" 
            android:gravity="center" 
            android:orientation="vertical"> 

            <ImageView 
             android:layout_width="wrap_content" 
             android:layout_height="wrap_content" 
             android:src="@drawable/todo_user" 
             android:visibility="visible" /> 
           </LinearLayout> 

           <LinearLayout 
            android:layout_width="match_parent" 
            android:layout_height="match_parent" 
            android:layout_marginLeft="@dimen/list_item_content_left_padding" 
            android:gravity="center_vertical" 
            android:orientation="vertical"> 

            <com.strait.solvenow.Utilities.WithoutPrimaryTextView 
             android:id="@+id/EditTodoTxtAssignToName" 
             android:layout_width="match_parent" 
             android:layout_height="wrap_content" 
             android:singleLine="true" 
             android:text="" /> 

            <com.strait.solvenow.Utilities.WithoutSecondaryTextView 
             android:id="@+id/EditTodoTxtAssignByName" 
             android:layout_width="match_parent" 
             android:layout_height="wrap_content" 
             android:singleLine="true" 
             android:text="" 

             /> 
           </LinearLayout> 
          </RelativeLayout> 

          <RelativeLayout 
           android:layout_width="match_parent" 
           android:layout_height="@dimen/todo_details_height" 
           android:gravity="center" 
           android:orientation="horizontal"> 

           <LinearLayout 
            android:layout_width="@dimen/avatar_icon_touch_area_size" 
            android:layout_height="@dimen/avatar_icon_touch_area_size" 
            android:gravity="center" 
            android:orientation="vertical"> 

            <ImageView 
             android:layout_width="wrap_content" 
             android:layout_height="wrap_content" 
             android:gravity="center_vertical" 
             android:src="@drawable/todo_due_date" /> 
           </LinearLayout> 

           <com.strait.solvenow.Utilities.WithoutPrimaryTextView 
            android:id="@+id/EditToDoTxtDueDate" 
            android:layout_width="match_parent" 
            android:layout_height="match_parent" 
            android:layout_marginLeft="@dimen/list_item_content_left_padding" 
            android:background="@null" 
            android:gravity="left|center" 
            android:text="@string/Due_Date" /> 

          </RelativeLayout> 

          <RelativeLayout 
           android:layout_width="match_parent" 
           android:layout_height="@dimen/todo_details_height" 
           android:gravity="center_vertical" 
           android:orientation="horizontal"> 

           <LinearLayout 
            android:layout_width="@dimen/avatar_icon_touch_area_size" 
            android:layout_height="@dimen/avatar_icon_touch_area_size" 
            android:gravity="center" 
            android:orientation="vertical"> 

            <ImageView 
             android:id="@+id/todoDetailsImgStatus" 
             android:layout_width="wrap_content" 
             android:layout_height="wrap_content" 
             android:src="@drawable/user_place_holder" /> 
           </LinearLayout> 

           <com.strait.solvenow.Utilities.WithoutPrimaryTextView 
            android:id="@+id/EditToDoTxtStatus" 
            android:layout_width="match_parent" 
            android:layout_height="match_parent" 
            android:layout_marginLeft="@dimen/list_item_content_left_padding" 
            android:background="@null" 
            android:gravity="left|center" 
            android:text="@string/Status" /> 

          </RelativeLayout> 

          <RelativeLayout 
           android:layout_width="match_parent" 
           android:layout_height="@dimen/todo_details_height" 
           android:gravity="center|left" 
           android:orientation="horizontal"> 

           <LinearLayout 
            android:layout_width="@dimen/avatar_icon_touch_area_size" 
            android:layout_height="@dimen/avatar_icon_touch_area_size" 
            android:gravity="center" 
            android:orientation="vertical"> 

            <ImageView 
             android:layout_width="wrap_content" 
             android:layout_height="wrap_content" 
             android:src="@drawable/todo_notification" /> 
           </LinearLayout> 

           <LinearLayout 
            android:layout_width="match_parent" 
            android:layout_height="match_parent" 
            android:layout_marginLeft="@dimen/list_item_content_left_padding" 
            android:orientation="horizontal"> 

            <com.strait.solvenow.Utilities.WithoutPrimaryTextView 
             android:id="@+id/todoDetailsTxtNotify" 
             android:layout_width="wrap_content" 
             android:layout_height="match_parent" 
             android:gravity="center" 
             android:text="@string/Notifications" /> 


            <android.support.v7.widget.SwitchCompat 
             android:id="@+id/todoEditTglNotification" 
             android:layout_width="wrap_content" 
             android:layout_height="match_parent" 
             android:layout_marginLeft="@dimen/ten_dp" 
             android:layout_toRightOf="@+id/todoDetailsTxtNotify" 
             android:background="@android:color/transparent" 
             android:button="@null" 
             android:checked="false" 
             android:text="" 
             android:textColor="@color/textColorWithoutPrimary" 
             android:textOff="" 
             android:textOn="" /> 

           </LinearLayout> 

          </RelativeLayout> 

          <RelativeLayout 
           android:layout_width="match_parent" 
           android:layout_height="@dimen/todo_details_height" 
           android:orientation="horizontal"> 

           <LinearLayout 
            android:layout_width="@dimen/avatar_icon_touch_area_size" 
            android:layout_height="@dimen/avatar_icon_touch_area_size" 
            android:gravity="center" 
            android:orientation="vertical"> 

            <ImageView 
             android:id="@+id/todoEditImgAttachment" 
             android:layout_width="wrap_content" 
             android:layout_height="wrap_content" 
             android:src="@drawable/todo_new_attach" /> 
           </LinearLayout> 

           <com.strait.solvenow.Utilities.WithoutPrimaryTextView 
            android:id="@+id/chatEditTxtAttachment" 
            android:layout_width="match_parent" 
            android:layout_height="match_parent" 
            android:layout_marginLeft="@dimen/list_item_content_left_padding" 
            android:gravity="center|left" 
            android:text="@string/Attachment" /> 

          </RelativeLayout> 

          <LinearLayout 
           android:layout_width="match_parent" 
           android:layout_height="@dimen/todo_details_height" 
           android:layout_marginLeft="@dimen/list_item_content_left_padding" 
           android:gravity="center|left" 
           android:orientation="horizontal"> 

           <com.strait.solvenow.Utilities.WithoutPrimaryTextView 
            android:id="@+id/chatEditTxtReminder" 
            android:layout_width="match_parent" 
            android:layout_height="match_parent" 
            android:layout_toRightOf="@+id/todoEditImgAttachment" 
            android:layout_weight="1" 
            android:gravity="center|left" 
            android:text="@string/Reminder" 
            android:visibility="visible" /> 

           <com.strait.solvenow.Utilities.WithoutPrimaryTextView 
            android:id="@+id/chatEditTxtForward" 
            android:layout_width="match_parent" 
            android:layout_height="match_parent" 
            android:layout_gravity="center" 
            android:layout_toRightOf="@+id/todoEditImgAttachment" 
            android:layout_weight="1" 
            android:gravity="center|left" 
            android:text="@string/Forward" /> 

           <com.strait.solvenow.Utilities.WithoutPrimaryTextView 
            android:id="@+id/chatEditTxtRejected" 
            android:layout_width="match_parent" 
            android:layout_height="match_parent" 
            android:layout_toRightOf="@+id/todoEditImgAttachment" 
            android:layout_weight="1" 
            android:gravity="center|left" 
            android:text="@string/Reject" /> 
          </LinearLayout> 


         </LinearLayout> 
        </android.support.v7.widget.CardView> 

        <!-- <android.support.v4.widget.SwipeRefreshLayout 
          android:id="@+id/todoSwipeRefresh" 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:layout_above="@+id/chatWindowBottomRl"> 
    --> 
        <android.support.v7.widget.RecyclerView 
         android:id="@+id/todoRv" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:paddingBottom="@dimen/five_dp" 
         android:paddingLeft="@dimen/activity_vertical_margin" 
         android:paddingRight="@dimen/activity_vertical_margin" 

         android:paddingTop="@dimen/ten_dp" 
         android:visibility="visible"></android.support.v7.widget.RecyclerView> 
        <!--</android.support.v4.widget.SwipeRefreshLayout>--> 
       </LinearLayout> 
      </android.support.v4.widget.NestedScrollView> 
     </LinearLayout> 


     <LinearLayout 
      android:id="@+id/todoDetailsBottomLl" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:orientation="vertical"> 

      <include 
       android:id="@+id/todoChatBottomVerticalLine" 
       layout="@layout/divider_view_line" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" /> 


      <RelativeLayout 
       android:layout_width="match_parent" 
       android:layout_height="50dp" 
       android:gravity="center" 
       android:background="@color/windowBackground" 
       android:paddingLeft="@dimen/activity_vertical_margin" 
       android:paddingRight="@dimen/activity_vertical_margin" 
       android:visibility="visible"> 


       <ImageView 
        android:id="@+id/todoChatImgAttachment" 
        android:layout_width="@dimen/avatar_icon_touch_area_size" 
        android:layout_height="@dimen/avatar_icon_touch_area_size" 
        android:layout_alignParentLeft="true" 
        android:layout_centerVertical="true" 
        android:padding="@dimen/icon_padding" 
        android:src="@drawable/chat_attachment" 
        android:visibility="visible" /> 


       <com.strait.solvenow.Utilities.WithoutEditTextView 
        android:id="@+id/todoChatEdtTextMsg" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginTop="@dimen/five_dp" 
        android:layout_toLeftOf="@+id/todoChatImgSend" 
        android:layout_toRightOf="@+id/todoChatImgAttachment" 
        android:background="@drawable/chat_window_text_msg_bg" 
        android:hint="" 
        android:maxLines="4" 
        android:minHeight="35dp" 
        android:paddingLeft="@dimen/ten_dp" 
        android:text="" 
        android:textSize="16sp" 
        android:visibility="visible" /> 

       <ImageView 
        android:id="@+id/todoChatImgSend" 
        android:layout_width="@dimen/avatar_icon_touch_area_size" 
        android:layout_height="@dimen/avatar_icon_touch_area_size" 
        android:layout_alignParentRight="true" 
        android:layout_centerVertical="true" 
        android:gravity="center" 
        android:padding="@dimen/icon_padding" 
        android:src="@drawable/send" 
        android:visibility="visible" /> 
      </RelativeLayout> 
     </LinearLayout> 

    </RelativeLayout> 
</android.support.design.widget.CoordinatorLayout> 

我已經使用嵌套的滾動視圖,但回收視圖內的循環圖中不嵌套滾動view.recycle視圖向下滾動,向下滾動,當鍵盤打開,新項目在循環view.here補充的是在我的代碼之上。Recycleview沒有嵌套滾動型機器人滾動

+0

把一些代碼,你已經嘗試 – Nikhil

+1

簡單。擺脫ScrollView。 RecyclerView處理您的滾動需求。 – mwieczorek

+0

我已經把我的代碼....請檢查我的代碼是什麼問題。 – Priyanka

回答

0

這一切首先是壞的佈局技術,你必須實現

根據Android的標準有一個佈局

內不超過兩個滾動的意見作出相同