mirror of
https://github.com/He4eT/yamf_launcher.git
synced 2026-05-05 01:47:24 +00:00
App alignment added
This commit is contained in:
parent
01b7400083
commit
8d0486bb2d
8 changed files with 221 additions and 46 deletions
|
|
@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
|||
import android.content.Context
|
||||
import android.content.pm.LauncherActivityInfo
|
||||
import android.os.UserHandle
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
|
@ -103,15 +104,33 @@ class AppMenuAdapter(
|
|||
override fun onBindViewHolder(holder: AppViewHolder, position: Int) {
|
||||
val app = apps[position]
|
||||
|
||||
holder.textView.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null)
|
||||
|
||||
if (app.second.second != 0) {
|
||||
holder.textView.setCompoundDrawablesWithIntrinsicBounds(ResourcesCompat.getDrawable(activity.resources, R.drawable.ic_work_app, null),null,null,null)
|
||||
}
|
||||
else {
|
||||
holder.textView.setCompoundDrawablesWithIntrinsicBounds(ResourcesCompat.getDrawable(activity.resources, R.drawable.ic_empty, null),null,null,null)
|
||||
}
|
||||
holder.textView.compoundDrawablePadding = 0
|
||||
|
||||
/*
|
||||
0 = left
|
||||
1 = center
|
||||
2 = right
|
||||
*/
|
||||
|
||||
when (sharedPreferenceManager.getAppMenuAlignment(activity)) {
|
||||
0 -> {
|
||||
holder.textView.setCompoundDrawablesWithIntrinsicBounds(holder.textView.compoundDrawables.filterNotNull().first(),null, null, null)
|
||||
holder.textView.gravity = Gravity.CENTER_VERTICAL or Gravity.START
|
||||
}
|
||||
1 -> {
|
||||
holder.textView.setCompoundDrawablesWithIntrinsicBounds(holder.textView.compoundDrawables.filterNotNull().first(),null,holder.textView.compoundDrawables.filterNotNull().first(), null)
|
||||
holder.textView.gravity = Gravity.CENTER
|
||||
}
|
||||
2 -> {
|
||||
holder.textView.setCompoundDrawablesWithIntrinsicBounds(null,null, holder.textView.compoundDrawables.filterNotNull().first(), null)
|
||||
holder.textView.gravity = Gravity.CENTER_VERTICAL or Gravity.END
|
||||
}
|
||||
}
|
||||
|
||||
val appInfo = app.first.activityInfo.applicationInfo
|
||||
holder.textView.text = sharedPreferenceManager.getAppName(activity, app.first.applicationInfo.packageName,app.second.second, holder.itemView.context.packageManager.getApplicationLabel(appInfo))
|
||||
|
|
@ -119,10 +138,29 @@ class AppMenuAdapter(
|
|||
holder.textView.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onViewAttachedToWindow(holder: AppViewHolder) {
|
||||
super.onViewAttachedToWindow(holder)
|
||||
when (sharedPreferenceManager.getAppMenuAlignment(activity)) {
|
||||
0 -> {
|
||||
holder.textView.setCompoundDrawablesWithIntrinsicBounds(holder.textView.compoundDrawables.filterNotNull().first(),null, null, null)
|
||||
holder.textView.gravity = Gravity.CENTER_VERTICAL or Gravity.START
|
||||
}
|
||||
1 -> {
|
||||
holder.textView.setCompoundDrawablesWithIntrinsicBounds(holder.textView.compoundDrawables.filterNotNull().first(),null,holder.textView.compoundDrawables.filterNotNull().first(), null)
|
||||
holder.textView.gravity = Gravity.CENTER
|
||||
}
|
||||
2 -> {
|
||||
holder.textView.setCompoundDrawablesWithIntrinsicBounds(null,null, holder.textView.compoundDrawables.filterNotNull().first(), null)
|
||||
holder.textView.gravity = Gravity.CENTER_VERTICAL or Gravity.END
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return apps.size
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
fun updateApps(newApps: List<Pair<LauncherActivityInfo, Pair<UserHandle, Int>>>) {
|
||||
apps = newApps.toMutableList()
|
||||
notifyDataSetChanged()
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.content.pm.LauncherActivityInfo
|
||||
import android.content.pm.LauncherApps
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
|
|
@ -15,12 +14,12 @@ import android.provider.MediaStore
|
|||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.GestureDetector
|
||||
import android.view.Gravity
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.EditText
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Spinner
|
||||
import android.widget.TextClock
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
|
|
@ -29,9 +28,8 @@ import androidx.annotation.RequiresApi
|
|||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.core.view.children
|
||||
import androidx.core.view.marginLeft
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import eu.ottop.yamlauncher.databinding.ActivityMainBinding
|
||||
|
|
@ -55,7 +53,7 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
|
||||
private lateinit var recyclerView: RecyclerView
|
||||
private lateinit var searchView: EditText
|
||||
private lateinit var adapter: AppMenuAdapter
|
||||
private var adapter: AppMenuAdapter? = null
|
||||
private var job: Job? = null
|
||||
val cameraIntent = Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE)
|
||||
val phoneIntent = Intent(Intent.ACTION_DIAL)
|
||||
|
|
@ -75,6 +73,8 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
private var clockMargin = 0
|
||||
private lateinit var constraintLayout: ConstraintLayout
|
||||
|
||||
private lateinit var dateText: TextClock
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
@ -95,7 +95,7 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
|
||||
setupApps()
|
||||
|
||||
val dateText = findViewById<TextClock>(R.id.text_date)
|
||||
dateText = findViewById(R.id.text_date)
|
||||
|
||||
batteryReceiver = BatteryReceiver.register(this, dateText)
|
||||
|
||||
|
|
@ -129,18 +129,20 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
unregisterReceiver(batteryReceiver)
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
startTask()
|
||||
|
||||
// Keyboard is sometimes open when going back to the app, so close it.
|
||||
closeKeyboard()
|
||||
setClockAlignment()
|
||||
setShortCutAlignment()
|
||||
|
||||
adapter?.notifyDataSetChanged()
|
||||
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
setClockAlignment()
|
||||
}
|
||||
|
||||
open inner class GestureListener : GestureDetector.SimpleOnGestureListener() {
|
||||
|
||||
|
|
@ -235,7 +237,6 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
|
||||
textView.setCompoundDrawablesWithIntrinsicBounds(ResourcesCompat.getDrawable(resources, R.drawable.ic_empty, null),null,null,null)
|
||||
|
||||
textView.compoundDrawablePadding = 0
|
||||
unselectedListeners(textView)
|
||||
}
|
||||
|
||||
|
|
@ -255,8 +256,8 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
Toast.makeText(this, "Long click to select an app", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
textView.setOnLongClickListener {
|
||||
adapter.menuMode = "shortcut"
|
||||
adapter.shortcutTextView = textView
|
||||
adapter?.menuMode = "shortcut"
|
||||
adapter?.shortcutTextView = textView
|
||||
toAppMenu()
|
||||
|
||||
return@setOnLongClickListener true
|
||||
|
|
@ -382,7 +383,7 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
}
|
||||
|
||||
fun openAppMenuActivity() {
|
||||
adapter.menuMode = "app"
|
||||
adapter?.menuMode = "app"
|
||||
binding.menutitle.visibility = View.GONE
|
||||
toAppMenu()
|
||||
}
|
||||
|
|
@ -441,9 +442,10 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
if (userProfile != 0) {
|
||||
shortcutView.setCompoundDrawablesWithIntrinsicBounds(ResourcesCompat.getDrawable(resources, R.drawable.ic_work_app, null),null,null,null)
|
||||
}
|
||||
else {
|
||||
else if (shortcutView.gravity != Gravity.CENTER) {
|
||||
shortcutView.setCompoundDrawablesWithIntrinsicBounds(ResourcesCompat.getDrawable(resources, R.drawable.ic_empty, null),null,null,null)
|
||||
}
|
||||
|
||||
shortcutView.text = textView.text.toString()
|
||||
shortcutView.setOnClickListener {
|
||||
val mainActivity = launcherApps.getActivityList(appInfo.applicationInfo.packageName, userHandle).firstOrNull()
|
||||
|
|
@ -510,11 +512,8 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
imm.hideSoftInputFromWindow(binding.root.windowToken, 0)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun updateMenu(updatedApps : List<Pair<LauncherActivityInfo, Pair<UserHandle, Int>>>) {
|
||||
adapter.updateApps(updatedApps)
|
||||
adapter?.updateApps(updatedApps)
|
||||
println("moved")
|
||||
}
|
||||
|
||||
|
|
@ -531,11 +530,59 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
}
|
||||
|
||||
private fun setClockAlignment() {
|
||||
val clockAlignment = sharedPreferenceManager.getClockAlignment(this@MainActivity)
|
||||
setConstraintAlignment(sharedPreferenceManager.getClockAlignment(this@MainActivity), clock.id, clockMargin)
|
||||
}
|
||||
|
||||
private fun setConstraintAlignment(alignment: Int, widgetId: Int, margin: Int) {
|
||||
|
||||
val constraintSet = ConstraintSet()
|
||||
constraintSet.clone(constraintLayout)
|
||||
println(clockAlignment)
|
||||
println(alignment)
|
||||
|
||||
/*
|
||||
0 = left
|
||||
1 = center
|
||||
2 = right
|
||||
*/
|
||||
if (alignment == 2) {
|
||||
constraintSet.clear(widgetId, ConstraintSet.START)
|
||||
}
|
||||
else if (alignment == 0) {
|
||||
constraintSet.clear(widgetId, ConstraintSet.END)
|
||||
}
|
||||
|
||||
if (alignment == 1 || alignment == 0) {
|
||||
constraintSet.connect(
|
||||
widgetId,
|
||||
ConstraintSet.START,
|
||||
ConstraintSet.PARENT_ID,
|
||||
ConstraintSet.START,
|
||||
margin
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
if (alignment != 0) {
|
||||
constraintSet.connect(
|
||||
widgetId,
|
||||
ConstraintSet.END,
|
||||
ConstraintSet.PARENT_ID,
|
||||
ConstraintSet.END,
|
||||
margin
|
||||
)
|
||||
}
|
||||
|
||||
constraintSet.applyTo(constraintLayout)
|
||||
}
|
||||
|
||||
private fun setShortCutAlignment() {
|
||||
setLinearAlignment(binding.homeView)
|
||||
}
|
||||
|
||||
private fun setLinearAlignment(shortcuts: LinearLayout) {
|
||||
shortcuts.children.forEach {
|
||||
|
||||
if (it is TextView) {
|
||||
|
||||
/*
|
||||
0 = left
|
||||
|
|
@ -543,34 +590,23 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
|
|||
2 = right
|
||||
*/
|
||||
|
||||
if (clockAlignment == 2) {
|
||||
constraintSet.clear(clock.id, ConstraintSet.START)
|
||||
when (sharedPreferenceManager.getHomeAppAlignment(this@MainActivity)) {
|
||||
0 -> {
|
||||
it.setCompoundDrawablesWithIntrinsicBounds(it.compoundDrawables.filterNotNull().first(),null, null, null)
|
||||
it.gravity = Gravity.CENTER_VERTICAL or Gravity.START
|
||||
}
|
||||
1 -> {
|
||||
it.setCompoundDrawablesWithIntrinsicBounds(it.compoundDrawables.filterNotNull().first(),null,it.compoundDrawables.filterNotNull().first(), null)
|
||||
it.gravity = Gravity.CENTER
|
||||
}
|
||||
2 -> {
|
||||
it.setCompoundDrawablesWithIntrinsicBounds(null,null, it.compoundDrawables.filterNotNull().first(), null)
|
||||
it.gravity = Gravity.CENTER_VERTICAL or Gravity.END
|
||||
}
|
||||
else if (clockAlignment == 0) {
|
||||
constraintSet.clear(clock.id, ConstraintSet.END)
|
||||
}
|
||||
|
||||
if (clockAlignment == 1 || clockAlignment == 0) {
|
||||
constraintSet.connect(
|
||||
clock.id,
|
||||
ConstraintSet.START,
|
||||
ConstraintSet.PARENT_ID,
|
||||
ConstraintSet.START,
|
||||
clockMargin
|
||||
)
|
||||
}
|
||||
|
||||
if (clockAlignment != 0) {
|
||||
constraintSet.connect(
|
||||
clock.id,
|
||||
ConstraintSet.END,
|
||||
ConstraintSet.PARENT_ID,
|
||||
ConstraintSet.END,
|
||||
clockMargin
|
||||
)
|
||||
}
|
||||
|
||||
constraintSet.applyTo(constraintLayout)
|
||||
}
|
||||
|
||||
fun isJobActive(): Boolean {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,30 @@ class SettingsActivity : AppCompatActivity() {
|
|||
override fun onItemSelected(parent: AdapterView<*>, view: View?, position: Int, id: Long) {
|
||||
// Get the selected item
|
||||
sharedPreferenceManager.setClockAlignment(this@SettingsActivity, position)
|
||||
println(position)
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>) {
|
||||
}
|
||||
}
|
||||
|
||||
binding.homeAppAlignment.setSelection(sharedPreferenceManager.getHomeAppAlignment(this@SettingsActivity))
|
||||
|
||||
binding.homeAppAlignment.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(parent: AdapterView<*>, view: View?, position: Int, id: Long) {
|
||||
// Get the selected item
|
||||
sharedPreferenceManager.setHomeAppAlignment(this@SettingsActivity, position)
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>) {
|
||||
}
|
||||
}
|
||||
|
||||
binding.appAlignment.setSelection(sharedPreferenceManager.getAppMenuAlignment(this@SettingsActivity))
|
||||
|
||||
binding.appAlignment.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
|
||||
override fun onItemSelected(parent: AdapterView<*>, view: View?, position: Int, id: Long) {
|
||||
// Get the selected item
|
||||
sharedPreferenceManager.setAppMenuAlignment(this@SettingsActivity, position)
|
||||
}
|
||||
|
||||
override fun onNothingSelected(parent: AdapterView<*>) {
|
||||
|
|
|
|||
|
|
@ -85,4 +85,30 @@ class SharedPreferenceManager {
|
|||
val key = "clock_alignment"
|
||||
return sharedPreferences.getInt(key, 0)
|
||||
}
|
||||
|
||||
fun setHomeAppAlignment(cont: Context, alignment: Int) {
|
||||
val editor = cont.getSharedPreferences("preferences", AppCompatActivity.MODE_PRIVATE).edit()
|
||||
val key = "home_app_alignment"
|
||||
editor.putInt(key, alignment)
|
||||
editor.apply()
|
||||
}
|
||||
|
||||
fun getHomeAppAlignment(cont: Context) : Int {
|
||||
val sharedPreferences = cont.getSharedPreferences("preferences", AppCompatActivity.MODE_PRIVATE)
|
||||
val key = "home_app_alignment"
|
||||
return sharedPreferences.getInt(key, 0)
|
||||
}
|
||||
|
||||
fun setAppMenuAlignment(cont: Context, alignment: Int) {
|
||||
val editor = cont.getSharedPreferences("preferences", AppCompatActivity.MODE_PRIVATE).edit()
|
||||
val key = "app_menu_alignment"
|
||||
editor.putInt(key, alignment)
|
||||
editor.apply()
|
||||
}
|
||||
|
||||
fun getAppMenuAlignment(cont: Context) : Int {
|
||||
val sharedPreferences = cont.getSharedPreferences("preferences", AppCompatActivity.MODE_PRIVATE)
|
||||
val key = "app_menu_alignment"
|
||||
return sharedPreferences.getInt(key, 0)
|
||||
}
|
||||
}
|
||||
|
|
@ -7,9 +7,9 @@
|
|||
android:alpha="1">
|
||||
<group android:scaleX="0.5"
|
||||
android:scaleY="0.5"
|
||||
android:translateX="0
|
||||
"
|
||||
android:translateX="6"
|
||||
android:translateY="6">
|
||||
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2z"/>
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@
|
|||
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
|
||||
android:textColor="#F3F3F3"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/text_clock"
|
||||
app:layout_constraintStart_toStartOf="@+id/text_clock"
|
||||
app:layout_constraintTop_toBottomOf="@+id/text_clock" />
|
||||
|
||||
|
|
@ -131,6 +132,7 @@
|
|||
android:autoSizeMaxTextSize="28sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:clickable="false"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
|
|
@ -152,6 +154,7 @@
|
|||
android:autoSizeMaxTextSize="28sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:clickable="false"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
|
|
@ -174,6 +177,7 @@
|
|||
android:autoSizeMaxTextSize="28sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:clickable="false"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
|
|
@ -196,6 +200,7 @@
|
|||
android:autoSizeMaxTextSize="28sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:clickable="false"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
|
|
@ -219,6 +224,7 @@
|
|||
android:autoSizeMaxTextSize="28sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:clickable="false"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
|
|
@ -242,6 +248,7 @@
|
|||
android:autoSizeMaxTextSize="28sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:clickable="false"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
|
|
@ -265,6 +272,7 @@
|
|||
android:autoSizeMaxTextSize="28sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:clickable="false"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
|
|
@ -288,6 +296,7 @@
|
|||
android:autoSizeMaxTextSize="28sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:clickable="false"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
app:layout_constraintBottom_toBottomOf="@+id/clock_alignment_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/home_app_alignment"
|
||||
android:id="@+id/home_app_alignment_label"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
|
|
@ -71,21 +71,63 @@
|
|||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner2"
|
||||
android:id="@+id/home_app_alignment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:entries="@array/clock_alignment_options"
|
||||
android:spinnerMode="dropdown"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/home_app_alignment"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/home_app_alignment_label"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/home_app_alignment"
|
||||
app:layout_constraintTop_toTopOf="@+id/home_app_alignment" />
|
||||
app:layout_constraintStart_toEndOf="@+id/home_app_alignment_label"
|
||||
app:layout_constraintTop_toTopOf="@+id/home_app_alignment_label" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?android:attr/listDivider"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/home_app_alignment" />
|
||||
app:layout_constraintBottom_toBottomOf="@+id/home_app_alignment_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_alignment_label"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:gravity="start"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="20dp"
|
||||
android:text="App Menu Alignment"
|
||||
android:textAppearance="@android:style/TextAppearance.DeviceDefault"
|
||||
android:textColor="#F3F3F3"
|
||||
android:textSize="20sp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/clock_alignment"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/divider3"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/app_alignment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:entries="@array/clock_alignment_options"
|
||||
android:spinnerMode="dropdown"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/app_alignment_label"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toEndOf="@+id/app_alignment_label"
|
||||
app:layout_constraintTop_toTopOf="@+id/app_alignment_label"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?android:attr/listDivider"
|
||||
app:layout_constraintTop_toBottomOf="@+id/app_alignment_label" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -54,6 +54,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:drawablePadding="3dp"
|
||||
android:gravity="start"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="20dp"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue