From 0d281fd0dd1e823e41712560586fed8f9b2b0e3c Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 29 Aug 2021 03:18:24 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=95=20Settings=20Menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mylloon/mobidl/MainActivity.kt | 160 +++++++++++------- app/src/main/res/layout/activity_login.xml | 27 +-- app/src/main/res/layout/activity_settings.xml | 52 +++++- app/src/main/res/menu/menu_main.xml | 2 +- app/src/main/res/values-fr-rFR/strings.xml | 5 + app/src/main/res/values/strings.xml | 8 + 6 files changed, 173 insertions(+), 81 deletions(-) diff --git a/app/src/main/java/com/mylloon/mobidl/MainActivity.kt b/app/src/main/java/com/mylloon/mobidl/MainActivity.kt index 5fe484f..5996602 100644 --- a/app/src/main/java/com/mylloon/mobidl/MainActivity.kt +++ b/app/src/main/java/com/mylloon/mobidl/MainActivity.kt @@ -2,20 +2,26 @@ package com.mylloon.mobidl import android.Manifest +import android.annotation.SuppressLint import android.content.Context +import android.content.Intent +import android.content.SharedPreferences import android.content.pm.PackageManager -import androidx.appcompat.app.AppCompatActivity import android.os.Bundle +import android.os.Handler +import android.os.Looper +import android.text.Editable +import android.text.TextWatcher +import android.view.Menu +import android.view.MenuItem import android.widget.Button import android.widget.EditText -import android.text.Editable - -import android.text.TextWatcher -import android.view.MenuItem -import android.view.Menu import android.widget.Toast +import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat -import android.content.SharedPreferences +import android.content.pm.PackageInfo +import android.net.Uri +import android.widget.TextView class MainActivity : AppCompatActivity() { @@ -30,7 +36,7 @@ class MainActivity : AppCompatActivity() { companion object { private var instance: MainActivity? = null - fun applicationContext() : Context { + fun applicationContext(): Context { return instance!!.applicationContext } } @@ -44,44 +50,6 @@ class MainActivity : AppCompatActivity() { super.onCreate(savedInstanceState) prefs = getSharedPreferences("com.mylloon.MobiDL", MODE_PRIVATE) - fun loginPage() { - setContentView(R.layout.activity_login) // show login page - - val userInput = findViewById(R.id.usernameInput) - val passwordInput = findViewById(R.id.passwordInput) - val buttonInput = findViewById