From 012921f88636e767f6a4b0825771f33226c54d63 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Thu, 3 Oct 2019 00:24:39 +0530 Subject: [PATCH] Layout update with constraints and font correction --- .../monkey/retromusic/views/ListItemView.kt | 54 +++ .../layout-sw600dp-land/activity_settings.xml | 8 +- .../res/layout-xlarge/activity_user_info.xml | 3 +- app/src/main/res/layout/activity_about.xml | 1 + .../main/res/layout/activity_bug_report.xml | 3 +- app/src/main/res/layout/activity_donation.xml | 27 +- .../main/res/layout/activity_equalizer.xml | 3 +- .../res/layout/activity_error_handler.xml | 2 +- app/src/main/res/layout/activity_license.xml | 1 + .../res/layout/activity_playing_queue.xml | 1 + .../main/res/layout/activity_pro_version.xml | 1 + .../res/layout/activity_song_tag_editor.xml | 1 + .../main/res/layout/activity_user_info.xml | 3 +- .../main/res/layout/activity_whats_new.xml | 3 +- app/src/main/res/layout/card_credit.xml | 17 +- app/src/main/res/layout/card_other.xml | 47 ++- app/src/main/res/layout/card_retro_info.xml | 348 ++++-------------- app/src/main/res/layout/card_social.xml | 207 +++-------- .../res/layout/fragment_main_settings.xml | 29 +- app/src/main/res/layout/item_contributor.xml | 5 +- .../res/layout/item_contributor_header.xml | 1 + app/src/main/res/layout/list_item_view.xml | 72 ++++ app/src/main/res/values/list_item_view.xml | 21 ++ app/src/main/res/values/styles.xml | 12 +- 24 files changed, 384 insertions(+), 486 deletions(-) create mode 100644 app/src/main/java/code/name/monkey/retromusic/views/ListItemView.kt create mode 100644 app/src/main/res/layout/list_item_view.xml create mode 100644 app/src/main/res/values/list_item_view.xml 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 new file mode 100644 index 00000000..19f97ae1 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/views/ListItemView.kt @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2019 Hemanth Savarala. + * + * Licensed under the GNU General Public License v3 + * + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by + * the Free Software Foundation either version 3 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + */ + +package code.name.monkey.retromusic.views + +import android.content.Context +import android.util.AttributeSet +import android.view.View +import android.widget.FrameLayout +import code.name.monkey.retromusic.R +import code.name.monkey.retromusic.extensions.hide +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) + } + + constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { + init(context, attrs) + } + + constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { + init(context, attrs) + } + + private fun init(context: Context, attrs: AttributeSet?) { + View.inflate(context, R.layout.list_item_view, this) + + val typedArray = context.obtainStyledAttributes(attrs, R.styleable.ListItemView) + appCompatImageView.setImageDrawable(typedArray.getDrawable(R.styleable.ListItemView_listItemIcon)) + title.text = typedArray.getText(R.styleable.ListItemView_listItemTitle) + if (typedArray.hasValue(R.styleable.ListItemView_listItemSummary)) { + summary.text = typedArray.getText(R.styleable.ListItemView_listItemSummary) + } else { + summary.hide() + } + typedArray.recycle() + } +} diff --git a/app/src/main/res/layout-sw600dp-land/activity_settings.xml b/app/src/main/res/layout-sw600dp-land/activity_settings.xml index eba0ce0f..bb5a7e8e 100644 --- a/app/src/main/res/layout-sw600dp-land/activity_settings.xml +++ b/app/src/main/res/layout-sw600dp-land/activity_settings.xml @@ -1,5 +1,4 @@ - - + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/list_item_view.xml b/app/src/main/res/values/list_item_view.xml new file mode 100644 index 00000000..1d49c011 --- /dev/null +++ b/app/src/main/res/values/list_item_view.xml @@ -0,0 +1,21 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 6a10d75e..2ddf296e 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -39,12 +39,13 @@ - -