update the settings screen

This commit is contained in:
tibbi 2017-03-10 23:15:27 +01:00
parent 9dd5d4a99e
commit ec1c3d20a3
3 changed files with 41 additions and 10 deletions

View File

@ -37,5 +37,10 @@
android:name=".activities.SettingsActivity" android:name=".activities.SettingsActivity"
android:label="@string/settings" android:label="@string/settings"
android:parentActivityName=".activities.MainActivity"/> android:parentActivityName=".activities.MainActivity"/>
<activity
android:name="com.simplemobiletools.commons.activities.CustomizationActivity"
android:label="@string/customize_colors"
android:parentActivityName=".activities.SettingsActivity"/>
</application> </application>
</manifest> </manifest>

View File

@ -1,6 +1,7 @@
package com.simplemobiletools.filemanager.activities package com.simplemobiletools.filemanager.activities
import android.os.Bundle import android.os.Bundle
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.filemanager.R import com.simplemobiletools.filemanager.R
import com.simplemobiletools.filemanager.extensions.config import com.simplemobiletools.filemanager.extensions.config
import kotlinx.android.synthetic.main.activity_settings.* import kotlinx.android.synthetic.main.activity_settings.*
@ -9,8 +10,20 @@ class SettingsActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings) setContentView(R.layout.activity_settings)
}
override fun onResume() {
super.onResume()
setupCustomizeColors()
setupShowHidden() setupShowHidden()
updateTextColors(settings_holder)
}
private fun setupCustomizeColors() {
settings_customize_colors_holder.setOnClickListener {
startCustomizationActivity()
}
} }
private fun setupShowHidden() { private fun setupShowHidden() {

View File

@ -12,28 +12,41 @@
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:id="@+id/settings_show_hidden_holder" android:id="@+id/settings_customize_colors_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/settings_padding" android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin"> android:padding="@dimen/activity_margin">
<TextView <com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_show_hidden_label" android:id="@+id/settings_customize_colors"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:paddingLeft="@dimen/settings_padding" android:paddingLeft="@dimen/medium_margin"
android:text="@string/show_hidden"/> android:paddingStart="@dimen/medium_margin"
android:text="@string/customize_colors"/>
<android.support.v7.widget.SwitchCompat </RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_hidden_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_show_hidden" android:id="@+id/settings_show_hidden"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@null" android:background="@null"
android:clickable="false"/> android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/show_hidden"/>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>