From 37440947d1f83429ac6ab7907c2242578f6721d5 Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Sat, 10 Jun 2023 08:40:01 +0200 Subject: [PATCH] Simplify StartActivity layout --- app/src/main/AndroidManifest.xml | 1 + .../nextpush/activities/StartActivity.kt | 16 +- .../res/drawable/ic_action_visibility.xml | 5 - app/src/main/res/drawable/ic_logo.xml | 4 +- app/src/main/res/layout/activity_start.xml | 135 ++++++++++++- app/src/main/res/layout/content_start.xml | 177 ------------------ 6 files changed, 133 insertions(+), 205 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_action_visibility.xml delete mode 100644 app/src/main/res/layout/content_start.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4f16a4d..b93ec3b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -25,6 +25,7 @@ diff --git a/app/src/main/java/org/unifiedpush/distributor/nextpush/activities/StartActivity.kt b/app/src/main/java/org/unifiedpush/distributor/nextpush/activities/StartActivity.kt index e6d5d0a..abe5512 100644 --- a/app/src/main/java/org/unifiedpush/distributor/nextpush/activities/StartActivity.kt +++ b/app/src/main/java/org/unifiedpush/distributor/nextpush/activities/StartActivity.kt @@ -4,17 +4,14 @@ import android.app.Activity import android.content.Context import android.content.Intent import android.os.Bundle -import android.text.InputType import android.util.Log import android.widget.Button import android.widget.EditText -import android.widget.ImageView -import android.widget.RelativeLayout +import android.widget.LinearLayout import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.core.view.isGone -import com.google.android.material.textfield.TextInputEditText import org.unifiedpush.distributor.nextpush.R import org.unifiedpush.distributor.nextpush.account.Account import org.unifiedpush.distributor.nextpush.account.Account.setTypeDirect @@ -25,7 +22,6 @@ import org.unifiedpush.distributor.nextpush.utils.TAG class StartActivity : AppCompatActivity() { private var onResult: ((activity: Activity, requestCode: Int, resultCode: Int, data: Intent?, block: (success: Boolean) -> Unit) -> Unit)? = null - private var passwordIsVisible = false override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -53,18 +49,10 @@ class StartActivity : AppCompatActivity() { login() } findViewById(R.id.manual_login).setOnClickListener { - findViewById(R.id.manual_login_wrapper).apply { + findViewById(R.id.manual_login_wrapper).apply { isGone = !isGone } } - findViewById(R.id.ic_show_password).setOnClickListener { - passwordIsVisible = !passwordIsVisible - findViewById(R.id.edt_password).inputType = - when (passwordIsVisible) { - false -> InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD - true -> InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD - } - } } public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { diff --git a/app/src/main/res/drawable/ic_action_visibility.xml b/app/src/main/res/drawable/ic_action_visibility.xml deleted file mode 100644 index b923c39..0000000 --- a/app/src/main/res/drawable/ic_action_visibility.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_logo.xml b/app/src/main/res/drawable/ic_logo.xml index f853b50..7b732f3 100644 --- a/app/src/main/res/drawable/ic_logo.xml +++ b/app/src/main/res/drawable/ic_logo.xml @@ -1,6 +1,6 @@ - + android:background="@color/nextcloud"> - + - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/content_start.xml b/app/src/main/res/layout/content_start.xml deleted file mode 100644 index dc5feae..0000000 --- a/app/src/main/res/layout/content_start.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file