add an activity for managing favorite items

This commit is contained in:
tibbi 2017-03-18 18:02:42 +01:00
parent f250fee69c
commit 20bfd48e3f
5 changed files with 72 additions and 0 deletions

View File

@ -28,6 +28,11 @@
android:label="@string/about"
android:parentActivityName=".activities.MainActivity"/>
<activity
android:name="com.simplemobiletools.filemanager.activities.FavoritesActivity"
android:label="@string/favorites"
android:parentActivityName=".activities.MainActivity"/>
<activity
android:name="com.simplemobiletools.commons.activities.LicenseActivity"
android:label="@string/third_party_licences"

View File

@ -0,0 +1,11 @@
package com.simplemobiletools.filemanager.activities
import android.os.Bundle
import com.simplemobiletools.filemanager.R
class FavoritesActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_favorites)
}
}

View File

@ -1,5 +1,6 @@
package com.simplemobiletools.filemanager.activities
import android.content.Intent
import android.os.Bundle
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.filemanager.R
@ -16,6 +17,7 @@ class SettingsActivity : SimpleActivity() {
super.onResume()
setupCustomizeColors()
setupManageFavorites()
setupShowHidden()
updateTextColors(settings_holder)
}
@ -26,6 +28,12 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupManageFavorites() {
settings_manage_favorites_holder.setOnClickListener {
startActivity(Intent(this, FavoritesActivity::class.java))
}
}
private fun setupShowHidden() {
settings_show_hidden.isChecked = config.showHidden
settings_show_hidden_holder.setOnClickListener {

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/favorites_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/favorites_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/favorites_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/favorites_placeholder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:paddingLeft="@dimen/big_margin"
android:paddingRight="@dimen/big_margin"
android:paddingTop="@dimen/activity_margin"
android:visibility="gone"/>
</RelativeLayout>
</ScrollView>

View File

@ -30,6 +30,25 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_manage_favorites_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.MyTextView
android:id="@+id/settings_manage_favorites"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/manage_favorites"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_show_hidden_holder"
android:layout_width="match_parent"