fix profile

This commit is contained in:
Kr328 committed 2019-11-30 23:09:26 +08:00
1 parent bd159ecb6e
commit fe9047ee40
8 files changed
+45 -52

No files matched your search

@@ -29,8 +29,6 @@ class ProfilesActivity : BaseActivity() {
it.profileService.setActiveProfile(id)
}
}
reloadList()
}
override fun onStart() {
@@ -43,6 +41,8 @@ class ProfilesActivity : BaseActivity() {
intArrayOf()
)
}
reloadList()
}
override fun onStop() {
@@ -41,15 +41,17 @@ class ProfileAdapter(private val context: Context, private val listener: (Int) -
listener(current.id)
}
with(current.token) {
when {
startsWith("http") || startsWith("content") -> {
holder.view.operation = context.getDrawable(R.drawable.ic_profile_refresh)
}
startsWith("file") -> {
holder.view.operation = context.getDrawable(R.drawable.ic_profile_edit)
}
}
}
holder.view.operation = context.getDrawable(R.drawable.ic_vert)
// with(current.token) {
// when {
// startsWith("http") || startsWith("content") -> {
//
// }
// startsWith("file") -> {
//
// }
// }
// }
}
}
@@ -20,7 +20,6 @@ class FatItem @JvmOverloads constructor(
private val summaryView: TextView
private val operationView: View
private val iconView: View
private val dividerView: View
private val clickable: View
private val operationClickable: View
@@ -85,7 +84,6 @@ class FatItem @JvmOverloads constructor(
titleView = findViewById(R.id.view_fat_item_title)
summaryView = findViewById(R.id.view_fat_item_summary)
operationView = findViewById(R.id.view_fat_item_operation)
dividerView = findViewById(R.id.view_fat_item_divider)
iconView = findViewById(R.id.view_fat_item_icon)
clickable = findViewById(R.id.view_fat_item_clickable)
operationClickable = findViewById(R.id.view_fat_item_operation_clickable)
@@ -21,7 +21,6 @@ class RadioFatItem @JvmOverloads constructor(
private val summaryView: TextView
private val operationView: View
private val radioView: MaterialRadioButton
private val dividerView: View
private val clickable: View
private val operationClickable: View
@@ -75,7 +74,6 @@ class RadioFatItem @JvmOverloads constructor(
titleView = findViewById(R.id.view_radio_fat_item_title)
summaryView = findViewById(R.id.view_radio_fat_item_summary)
operationView = findViewById(R.id.view_radio_fat_item_operation)
dividerView = findViewById(R.id.view_radio_fat_item_divider)
radioView = findViewById(R.id.view_radio_fat_item_radio)
clickable = findViewById(R.id.view_radio_fat_item_clickable)
operationClickable = findViewById(R.id.view_radio_fat_item_operation_clickable)
+9
View File
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>
+8 -18
View File
@@ -27,23 +27,22 @@
<TextView
android:id="@+id/view_fat_item_title"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@android:color/black"
android:textSize="16sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="5dp"
android:layout_marginTop="2dp"
android:id="@+id/view_fat_item_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
<FrameLayout
android:id="@+id/view_fat_item_operation_clickable"
android:layout_width="81dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="?attr/selectableItemBackground"
android:focusable="true"
android:clickable="true"
@@ -51,21 +50,12 @@
android:layout_alignTop="@id/view_fat_item_text_container"
android:layout_alignBottom="@id/view_fat_item_text_container">
<View
android:id="@+id/view_fat_item_divider"
android:layout_width="1dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content"
android:background="@color/lightGray"
android:layout_marginEnd="25dp" />
<View
android:id="@+id/view_fat_item_operation"
android:layout_marginEnd="25dp"
android:layout_gravity="center"
android:layout_width="30dp"
android:layout_height="30dp" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
@@ -30,23 +30,22 @@
<TextView
android:id="@+id/view_radio_fat_item_title"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@android:color/black"
android:textSize="16sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="5dp"
android:layout_marginTop="2dp"
android:id="@+id/view_radio_fat_item_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
<FrameLayout
android:id="@+id/view_radio_fat_item_operation_clickable"
android:layout_width="81dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_width="80dp"
android:layout_height="80dp"
android:focusable="true"
android:clickable="true"
android:background="?attr/selectableItemBackground"
@@ -54,21 +53,12 @@
android:layout_alignTop="@id/view_radio_fat_item_text_container"
android:layout_alignBottom="@id/view_radio_fat_item_text_container">
<View
android:id="@+id/view_radio_fat_item_divider"
android:layout_width="1dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content"
android:background="@color/lightGray"
android:layout_marginEnd="25dp" />
<View
android:id="@+id/view_radio_fat_item_operation"
android:layout_marginEnd="25dp"
android:layout_gravity="center"
android:layout_width="30dp"
android:layout_height="30dp" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>