mirror of
https://github.com/nextcloud/android.git
synced 2024-11-21 20:55:31 +03:00
initial link of menu buttons
This commit is contained in:
parent
c0afddd5d8
commit
038f3167ab
3 changed files with 45 additions and 27 deletions
|
@ -21,7 +21,9 @@
|
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/standard_padding">
|
||||
android:paddingLeft="@dimen/standard_padding"
|
||||
android:paddingTop="@dimen/standard_padding"
|
||||
android:paddingBottom="@dimen/standard_padding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
|
@ -45,21 +47,22 @@
|
|||
android:id="@+id/syncStatusButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/standard_half_margin"
|
||||
android:padding="@dimen/standard_half_padding"
|
||||
android:background="@color/transparent"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/ic_cloud_sync_off"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/settingsButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/standard_half_margin"
|
||||
android:layout_marginTop="@dimen/standard_half_margin"
|
||||
android:layout_marginBottom="@dimen/standard_half_margin"
|
||||
android:background="@color/transparent"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/ic_dots_vertical"/>
|
||||
<ImageButton
|
||||
android:id="@+id/settingsButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/standard_half_padding"
|
||||
android:paddingTop="@dimen/standard_half_padding"
|
||||
android:paddingBottom="@dimen/standard_half_padding"
|
||||
android:paddingRight="@dimen/standard_padding"
|
||||
android:background="@color/transparent"
|
||||
android:clickable="true"
|
||||
android:src="@drawable/ic_dots_vertical"/>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
|
@ -57,6 +57,15 @@
|
|||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="+"
|
||||
android:textColor="#bcbcbc"
|
||||
android:textSize="22dp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/counter"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -66,17 +75,6 @@
|
|||
android:textColor="#ffffff"
|
||||
android:textSize="22dp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:text=">"
|
||||
android:textColor="#dedede"
|
||||
android:textSize="22dp"
|
||||
android:textStyle="bold"/>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import android.widget.ImageButton;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.afollestad.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||
import com.owncloud.android.R;
|
||||
|
@ -95,14 +96,30 @@ public class FolderSyncAdapter extends SectionedRecyclerViewAdapter<FolderSyncAd
|
|||
|
||||
@Override
|
||||
public void onBindHeaderViewHolder(MainViewHolder holder, int section) {
|
||||
final int sectionId = section;
|
||||
holder.title.setText(mMediaFolders.get(section).folder.substring(mMediaFolders.get(section).folder
|
||||
.lastIndexOf("/") + 1, mMediaFolders.get(section).folder.length()));
|
||||
holder.syncStatusButton.setVisibility(View.VISIBLE);
|
||||
holder.syncStatusButton.setTag(section);
|
||||
holder.syncStatusButton.setOnTouchListener(this);
|
||||
holder.syncStatusButton.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
Toast.makeText(mContext, "Sync Status Clicked for " + mMediaFolders.get(sectionId).folder, Toast
|
||||
.LENGTH_SHORT)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
holder.menuButton.setVisibility(View.VISIBLE);
|
||||
holder.menuButton.setTag(section);
|
||||
holder.menuButton.setOnTouchListener(this);
|
||||
holder.menuButton.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
Toast.makeText(mContext, "Menu Clicked for " + mMediaFolders.get(sectionId).folder, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -199,8 +216,8 @@ public class FolderSyncAdapter extends SectionedRecyclerViewAdapter<FolderSyncAd
|
|||
super(itemView);
|
||||
image = (ImageView) itemView.findViewById(R.id.thumbnail);
|
||||
title = (TextView) itemView.findViewById(R.id.title);
|
||||
menuButton = (ImageButton) itemView.findViewById(R.id.syncStatusButton);
|
||||
syncStatusButton = (ImageButton) itemView.findViewById(R.id.settingsButton);
|
||||
menuButton = (ImageButton) itemView.findViewById(R.id.settingsButton);
|
||||
syncStatusButton = (ImageButton) itemView.findViewById(R.id.syncStatusButton);
|
||||
counterBar = (LinearLayout) itemView.findViewById(R.id.counterLayout);
|
||||
counterValue = (TextView) itemView.findViewById(R.id.counter);
|
||||
thumbnailDarkener = (ImageView) itemView.findViewById(R.id.thumbnailDarkener);
|
||||
|
|
Loading…
Reference in a new issue