From 64de9b485d42fee572e012a61601fa8c316fc64d Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 10 Jan 2019 19:47:15 +0000 Subject: [PATCH] profile list: larger profile names, add URL sub-head style --- .../ui/activity/ProfileListActivity.java | 9 ++++- app/src/main/res/layout/profile_list.xml | 2 -- .../main/res/layout/profile_list_content.xml | 33 +++++++++++++++++-- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileListActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileListActivity.java index 66288d52..03088b47 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileListActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileListActivity.java @@ -204,7 +204,11 @@ public class ProfileListActivity extends AppCompatActivity { final MobileLedgerProfile currentProfile = Data.profile.get(); Log.d("profiles", String.format("pos %d: %s, current: %s", position, profile.getUuid(), currentProfile.getUuid())); - holder.mRadioView.setText(profile.getName()); + View.OnClickListener profileSelector = v -> holder.mRadioView.setChecked(true); + holder.mTitle.setText(profile.getName()); + holder.mTitle.setOnClickListener(profileSelector); + holder.mSubTitle.setText(profile.getUrl()); + holder.mSubTitle.setOnClickListener(profileSelector); holder.mRadioView.setChecked(profile.getUuid().equals(currentProfile.getUuid())); holder.mRadioView .setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @@ -227,11 +231,14 @@ public class ProfileListActivity extends AppCompatActivity { class ProfileListViewHolder extends RecyclerView.ViewHolder { final RadioButton mRadioView; final TextView mEditButton; + final TextView mTitle, mSubTitle; ProfileListViewHolder(View view) { super(view); mRadioView = view.findViewById(R.id.profile_list_radio); mEditButton = view.findViewById(R.id.profile_list_edit_button); + mTitle = view.findViewById(R.id.title); + mSubTitle = view.findViewById(R.id.subtitle); } } } diff --git a/app/src/main/res/layout/profile_list.xml b/app/src/main/res/layout/profile_list.xml index cb915aaa..ac83fc75 100644 --- a/app/src/main/res/layout/profile_list.xml +++ b/app/src/main/res/layout/profile_list.xml @@ -23,8 +23,6 @@ android:name="net.ktnx.mobileledger.ui.activity.ProfileListFragment" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" app:layoutManager="LinearLayoutManager" tools:context=".ui.activity.ProfileListActivity" tools:listitem="@layout/profile_list_content" /> \ No newline at end of file diff --git a/app/src/main/res/layout/profile_list_content.xml b/app/src/main/res/layout/profile_list_content.xml index 68fa9a96..495acdde 100644 --- a/app/src/main/res/layout/profile_list_content.xml +++ b/app/src/main/res/layout/profile_list_content.xml @@ -30,6 +30,7 @@ android:id="@+id/profile_list_edit_button" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginEnd="16dp" android:layout_weight="9" android:drawableStart="@drawable/ic_mode_edit_black_24dp" android:padding="8dp" @@ -39,15 +40,41 @@ + + + + \ No newline at end of file -- 2.39.2