From 89fa903f532214f901b3e0dd1b0ad98d33bd0447 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Tue, 5 Nov 2019 00:29:44 +0530 Subject: [PATCH] Fix about text --- .../retromusic/activities/AboutActivity.kt | 2 +- .../monkey/retromusic/views/ListItemView.kt | 15 +-- app/src/main/res/layout/card_other.xml | 91 +++---------------- app/src/main/res/layout/item_contributor.xml | 1 - .../res/layout/item_contributor_header.xml | 6 +- 5 files changed, 26 insertions(+), 89 deletions(-) diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt index d89a0938..d3e3f1ee 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt @@ -69,7 +69,7 @@ class AboutActivity : AbsBaseActivity(), View.OnClickListener { loadContributors() setSupportActionBar(toolbar) ToolbarContentTintHelper.colorBackButton(toolbar ) - appVersion.text = getAppVersion() + version.setSummary ( getAppVersion()) setUpView() } diff --git a/app/src/main/java/code/name/monkey/retromusic/views/ListItemView.kt b/app/src/main/java/code/name/monkey/retromusic/views/ListItemView.kt index 5ebfd419..aea3312c 100644 --- a/app/src/main/java/code/name/monkey/retromusic/views/ListItemView.kt +++ b/app/src/main/java/code/name/monkey/retromusic/views/ListItemView.kt @@ -18,16 +18,17 @@ import android.content.Context import android.util.AttributeSet import android.view.View import android.widget.FrameLayout -import androidx.constraintlayout.widget.ConstraintLayout import code.name.monkey.retromusic.R import code.name.monkey.retromusic.extensions.hide -import code.name.monkey.retromusic.util.DensityUtil +import code.name.monkey.retromusic.extensions.show import kotlinx.android.synthetic.main.list_item_view.view.* /** * Created by hemanths on 2019-10-02. */ class ListItemView : FrameLayout { + + constructor(context: Context) : super(context) { init(context, null) } @@ -47,10 +48,7 @@ class ListItemView : FrameLayout { if (typedArray.hasValue(R.styleable.ListItemView_listItemIcon)) { icon.setImageDrawable(typedArray.getDrawable(R.styleable.ListItemView_listItemIcon)) } else { - val params = title.layoutParams as ConstraintLayout.LayoutParams - val startDP = DensityUtil.dip2px(context, 72.0f) - params.setMargins(startDP, title.paddingTop, title.paddingRight, title.paddingBottom) - summary.setPadding(startDP, title.paddingTop, title.paddingRight, title.paddingBottom) + icon.hide() } @@ -62,4 +60,9 @@ class ListItemView : FrameLayout { } typedArray.recycle() } + + fun setSummary(appVersion: String) { + summary.show() + summary.text = appVersion + } } \ No newline at end of file diff --git a/app/src/main/res/layout/card_other.xml b/app/src/main/res/layout/card_other.xml index e4187fa3..d0ad5661 100644 --- a/app/src/main/res/layout/card_other.xml +++ b/app/src/main/res/layout/card_other.xml @@ -1,7 +1,6 @@ - + app:listItemSummary="@string/changelog_summary" + app:listItemTitle="@string/changelog" /> - - - - - - - + app:listItemSummary="@string/pref_summary_open_source_licences" + app:listItemTitle="@string/pref_title_open_source_licences" /> - - - - - - - - - - - + app:listItemSummary="@string/pref_summary_open_source_licences" + app:listItemTitle="@string/version" /> + app:srcCompat="@drawable/ic_person_flat" + tools:srcCompat="@tools:sample/backgrounds/scenic[20]" />