xiongzhu hace 3 años
padre
commit
1aaf294d98

+ 35 - 3
app/build.gradle

@@ -1,11 +1,12 @@
 apply plugin: 'com.android.application'
+apply plugin: 'org.jetbrains.kotlin.android'
 
 android {
     compileSdkVersion 33
     buildToolsVersion '30.0.3'
     defaultConfig {
         applicationId "com.dar.nbook"
-        minSdkVersion 14
+        minSdkVersion 21
         targetSdkVersion 33
         versionCode 301
         multiDexEnabled true
@@ -28,14 +29,31 @@ android {
         }
     }
     compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_8
-        targetCompatibility JavaVersion.VERSION_1_8
+        sourceCompatibility JavaVersion.VERSION_17
+        targetCompatibility JavaVersion.VERSION_17
     }
     lint {
         abortOnError false
         checkReleaseBuilds false
     }
     namespace 'com.dar.nbook'
+    kotlinOptions {
+        jvmTarget = '17'
+    }
+    buildFeatures {
+        compose true
+    }
+    composeOptions {
+        kotlinCompilerExtensionVersion '1.4.3'
+    }
+    packagingOptions {
+        resources {
+            excludes += '/META-INF/{AL2.0,LGPL2.1}'
+        }
+    }
+    viewBinding {
+        enabled = true
+    }
 }
 
 dependencies {
@@ -60,10 +78,24 @@ dependencies {
     }
     implementation "androidx.multidex:multidex:2.0.1"
     implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
+    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
+    implementation 'androidx.activity:activity-compose:1.5.1'
+    implementation platform('androidx.compose:compose-bom:2022.10.00')
+    implementation 'androidx.compose.ui:ui'
+    implementation 'androidx.compose.ui:ui-graphics'
+    implementation 'androidx.compose.ui:ui-tooling-preview'
+    implementation 'androidx.compose.material3:material3'
+    androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
+    androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
     annotationProcessor 'com.github.bumptech.glide:compiler:4.15.0'
     implementation 'com.github.yukuku:ambilwarna:2.0.1'
     implementation 'me.zhanghai.android.fastscroll:library:1.2.0'
 
     implementation 'net.opacapp:multiline-collapsingtoolbar:27.1.1'
     implementation 'com.zeugmasolutions.localehelper:locale-helper-android:1.5.1'
+
+    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
+    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
+    debugImplementation 'androidx.compose.ui:ui-tooling'
+    debugImplementation 'androidx.compose.ui:ui-test-manifest'
 }

+ 25 - 12
app/src/main/AndroidManifest.xml

@@ -2,6 +2,8 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools">
 
+    <uses-sdk tools:overrideLibrary="me.zhanghai.android.fastscroll" />
+
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
@@ -10,7 +12,17 @@
     <uses-permission android:name="android.permission.WAKE_LOCK" />
     <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
 
-    <uses-sdk tools:overrideLibrary="me.zhanghai.android.fastscroll" />
+    <queries>
+        <intent>
+            <action android:name="android.intent.action.VIEW" />
+
+            <data android:mimeType="application/pdf" />
+        </intent>
+    </queries>
+
+    <meta-data
+        android:name="com.dar.nbook.components.classes.integration.OkHttpGlideModule"
+        android:value="GlideModule" />
 
     <application
         android:name=".components.activities.CrashApplication"
@@ -21,8 +33,16 @@
         android:requestLegacyExternalStorage="true"
         android:roundIcon="@mipmap/ic_launcher"
         android:supportsRtl="true"
-        android:theme="@style/DarkTheme">
-
+        android:theme="@style/DarkTheme"
+        android:usesCleartextTraffic="true">
+        <activity
+            android:name=".BLoginActivity"
+            android:exported="false" />
+        <activity
+            android:name=".NLoginActivity"
+            android:exported="false"
+            android:label="@string/title_activity_nlogin"
+            android:theme="@style/DarkTheme" />
         <activity android:name=".StatusManagerActivity" />
         <activity
             android:name=".PINActivity"
@@ -45,6 +65,7 @@
             android:targetActivity=".PINActivity">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
+
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity-alias>
@@ -58,6 +79,7 @@
             android:targetActivity=".PINActivity">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
+
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity-alias>
@@ -222,13 +244,4 @@
             android:permission="android.permission.BIND_JOB_SERVICE" />
     </application>
 
-    <queries>
-        <intent>
-            <action android:name="android.intent.action.VIEW" />
-            <data android:mimeType="application/pdf" />
-        </intent>
-    </queries>
-    <meta-data
-        android:name="com.dar.nbook.components.classes.integration.OkHttpGlideModule"
-        android:value="GlideModule" />
 </manifest>

+ 17 - 0
app/src/main/java/com/dar/nbook/BLoginActivity.kt

@@ -0,0 +1,17 @@
+package com.dar.nbook
+
+import androidx.appcompat.app.AppCompatActivity
+import android.os.Bundle
+import com.dar.nbook.databinding.ActivityBloginBinding
+
+class BLoginActivity : AppCompatActivity() {
+
+    private lateinit var binding: ActivityBloginBinding
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        binding = ActivityBloginBinding.inflate(layoutInflater)
+        val view = binding.root
+        setContentView(view)
+    }
+}

+ 37 - 1
app/src/main/java/com/dar/nbook/MainActivity.java

@@ -10,6 +10,7 @@ import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
+import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
@@ -31,9 +32,13 @@ import androidx.recyclerview.widget.RecyclerView;
 
 import com.bumptech.glide.RequestManager;
 import com.dar.nbook.adapters.ListAdapter;
+import com.dar.nbook.api.HttpCallback;
+import com.dar.nbook.api.HttpError;
 import com.dar.nbook.api.InspectorV3;
+import com.dar.nbook.api.HttpClient;
 import com.dar.nbook.api.components.Gallery;
 import com.dar.nbook.api.components.GenericGallery;
+import com.dar.nbook.api.components.NUser;
 import com.dar.nbook.api.components.Ranges;
 import com.dar.nbook.api.components.Tag;
 import com.dar.nbook.api.enums.ApiRequestType;
@@ -42,6 +47,9 @@ import com.dar.nbook.api.enums.SortType;
 import com.dar.nbook.api.enums.SpecialTagIds;
 import com.dar.nbook.api.enums.TagStatus;
 import com.dar.nbook.api.enums.TagType;
+import com.dar.nbook.api.request.UserLogin;
+import com.dar.nbook.api.request.UserRegister;
+import com.dar.nbook.api.response.LoginResponse;
 import com.dar.nbook.async.ScrapeTags;
 import com.dar.nbook.async.VersionChecker;
 import com.dar.nbook.async.database.Queries;
@@ -69,6 +77,9 @@ import java.util.Locale;
 import java.util.Objects;
 
 import okhttp3.Cookie;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
 
 public class MainActivity extends BaseActivity
     implements NavigationView.OnNavigationItemSelectedListener {
@@ -186,6 +197,31 @@ public class MainActivity extends BaseActivity
             .centerCrop()
             .placeholder(R.drawable.ic_logo)
             .into(ivAd);
+
+        HttpClient.request(HttpClient.getApiService().register(new UserRegister("asdf1", "123456", null)), new HttpCallback<NUser>() {
+            @Override
+            public void onSuccess(NUser data) {
+                LogUtility.d("Register success");
+                HttpClient.request(HttpClient.getApiService().login(new UserLogin("asdf1", "123456")), new HttpCallback<LoginResponse>() {
+                    @Override
+                    public void onSuccess(LoginResponse data) {
+                        LogUtility.d("Login success");
+                    }
+
+                    @Override
+                    public void onFailure(HttpError<LoginResponse> error) {
+                        LogUtility.e("Login failed");
+                    }
+                });
+            }
+
+            @Override
+            public void onFailure(HttpError<NUser> error) {
+                LogUtility.e("Register failed");
+            }
+        });
+
+
     }
 
     private void manageDrawer() {
@@ -769,7 +805,7 @@ public class MainActivity extends BaseActivity
             if (Login.isLogged())
                 showLogoutForm();
             else {
-                intent = new Intent(this, LoginActivity.class);
+                intent = new Intent(this, BLoginActivity.class);
                 startActivity(intent);
             }
         } else if (item.getItemId() == R.id.random) {

+ 69 - 0
app/src/main/java/com/dar/nbook/NLoginActivity.kt

@@ -0,0 +1,69 @@
+@file:OptIn(ExperimentalMaterial3Api::class)
+
+package com.dar.nbook
+
+import android.os.Bundle
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.material3.ExperimentalMaterial3Api
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Surface
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextField
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.tooling.preview.Preview
+import com.dar.nbook.settings.Global
+import com.dar.nbook.ui.theme.NClientV2Theme
+
+class NLoginActivity : ComponentActivity() {
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        setContent {
+            NClientV2Theme(darkTheme = Global.getTheme() == Global.ThemeScheme.DARK) {
+                // A surface container using the 'background' color from the theme
+                Surface(
+                    modifier = Modifier.fillMaxSize(),
+                    color = MaterialTheme.colorScheme.background
+                ) {
+                    Login()
+                }
+            }
+        }
+    }
+}
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+    Text(
+        text = "Hello $name!",
+        modifier = modifier
+    )
+}
+
+@Composable
+fun Login() {
+    var username by remember { mutableStateOf("Hello") }
+    Column {
+        TextField(
+            value = username,
+            onValueChange = { username = it },
+            label = { Text("Label") }
+        )
+    }
+}
+
+@Preview(showBackground = true)
+@Composable
+fun GreetingPreview() {
+    NClientV2Theme {
+        Login()
+    }
+}

+ 19 - 0
app/src/main/java/com/dar/nbook/api/ApiService.java

@@ -0,0 +1,19 @@
+package com.dar.nbook.api;
+
+import com.dar.nbook.api.components.NUser;
+import com.dar.nbook.api.request.UserLogin;
+import com.dar.nbook.api.request.UserRegister;
+import com.dar.nbook.api.response.LoginResponse;
+
+import retrofit2.Call;
+import retrofit2.http.Body;
+import retrofit2.http.POST;
+
+public interface ApiService {
+
+    @POST("auth/login")
+    Call<LoginResponse> login(@Body UserLogin userLogin);
+
+    @POST("auth/register")
+    Call<NUser> register(@Body UserRegister userRegister);
+}

+ 12 - 0
app/src/main/java/com/dar/nbook/api/HttpCallback.java

@@ -0,0 +1,12 @@
+package com.dar.nbook.api;
+
+import com.dar.nbook.api.response.LoginResponse;
+
+import retrofit2.Call;
+
+public interface HttpCallback<T> {
+
+    void onSuccess(T data);
+
+    void onFailure(HttpError<T> error);
+}

+ 69 - 0
app/src/main/java/com/dar/nbook/api/HttpClient.java

@@ -0,0 +1,69 @@
+package com.dar.nbook.api;
+
+import com.dar.nbook.api.response.LoginResponse;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.IOException;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+import retrofit2.Retrofit;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+public class HttpClient {
+    private static volatile Retrofit retrofit;
+    private static final String BASE_URL = "http://147.139.168.134:3000/api/";
+
+    private static Retrofit getRetrofit() {
+        if (retrofit == null) {
+            synchronized (HttpClient.class) {
+                if (retrofit == null) {
+                    retrofit = new Retrofit.Builder()
+                        .baseUrl(BASE_URL)
+                        .addConverterFactory(GsonConverterFactory.create())
+                        .build();
+                }
+            }
+        }
+        return retrofit;
+    }
+
+    public static ApiService getApiService() {
+        return getRetrofit().create(ApiService.class);
+    }
+
+
+    public static <T> void request(Call<T> call, HttpCallback<T> callback) {
+        call.enqueue(new Callback<T>() {
+            @Override
+            public void onResponse(Call<T> call, Response<T> response) {
+                if (response.isSuccessful()) {
+                    callback.onSuccess(response.body());
+                } else {
+                    HttpError<T> error = new HttpError<>();
+                    error.setCall(call);
+                    error.setStatus(response.code());
+
+                    try {
+                        String body = response.errorBody().string();
+                        JSONObject jsonObject = new JSONObject(body);
+                        error.setMessage(jsonObject.getString("message"));
+                    } catch (IOException | JSONException e) {
+                        error.setMessage(e.getMessage());
+                    }
+                    callback.onFailure(error);
+                }
+            }
+
+            @Override
+            public void onFailure(Call<T> call, Throwable t) {
+                HttpError<T> error = new HttpError<>();
+                error.setCall(call);
+                error.setMessage(t.getMessage());
+            }
+        });
+    }
+}

+ 42 - 0
app/src/main/java/com/dar/nbook/api/HttpError.java

@@ -0,0 +1,42 @@
+package com.dar.nbook.api;
+
+import retrofit2.Call;
+
+public class HttpError<T> {
+    private Call<T> call;
+    private Throwable t;
+    private String message;
+    private int status;
+
+    public Call<T> getCall() {
+        return call;
+    }
+
+    public void setCall(Call<T> call) {
+        this.call = call;
+    }
+
+    public Throwable getT() {
+        return t;
+    }
+
+    public void setT(Throwable t) {
+        this.t = t;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public void setStatus(int status) {
+        this.status = status;
+    }
+}

+ 56 - 0
app/src/main/java/com/dar/nbook/api/components/NUser.java

@@ -0,0 +1,56 @@
+package com.dar.nbook.api.components;
+
+import java.util.Date;
+
+public class NUser {
+
+    private Integer id;
+
+    private String name;
+
+    private String username;
+
+    private String avatar;
+
+    private Date createdAt;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public Date getCreatedAt() {
+        return createdAt;
+    }
+
+    public void setCreatedAt(Date createdAt) {
+        this.createdAt = createdAt;
+    }
+}

+ 27 - 0
app/src/main/java/com/dar/nbook/api/request/UserLogin.java

@@ -0,0 +1,27 @@
+package com.dar.nbook.api.request;
+
+public class UserLogin {
+    private String username;
+    private String password;
+
+    public UserLogin(String username, String password) {
+        this.username = username;
+        this.password = password;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}

+ 40 - 0
app/src/main/java/com/dar/nbook/api/request/UserRegister.java

@@ -0,0 +1,40 @@
+package com.dar.nbook.api.request;
+
+public class UserRegister {
+
+    private String username;
+
+    private String password;
+
+    private Integer invitor;
+
+    public UserRegister(String username, String password, Integer invitor) {
+        this.username = username;
+        this.password = password;
+        this.invitor = invitor;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public Integer getInvitor() {
+        return invitor;
+    }
+
+    public void setInvitor(Integer invitor) {
+        this.invitor = invitor;
+    }
+}

+ 15 - 0
app/src/main/java/com/dar/nbook/api/response/LoginResponse.java

@@ -0,0 +1,15 @@
+package com.dar.nbook.api.response;
+
+
+public class LoginResponse {
+
+    private String access_token;
+
+    public String getAccess_token() {
+        return access_token;
+    }
+
+    public void setAccess_token(String access_token) {
+        this.access_token = access_token;
+    }
+}

+ 4 - 0
app/src/main/java/com/dar/nbook/api/response/RegisterResponse.java

@@ -0,0 +1,4 @@
+package com.dar.nbook.api.response;
+
+public class RegisterResponse {
+}

+ 1 - 0
app/src/main/java/com/dar/nbook/settings/Global.java

@@ -36,6 +36,7 @@ import com.dar.nbook.api.enums.Language;
 import com.dar.nbook.api.enums.SortType;
 import com.dar.nbook.api.enums.TitleType;
 import com.dar.nbook.api.local.LocalSortType;
+import com.dar.nbook.api.request.UserLogin;
 import com.dar.nbook.components.CustomCookieJar;
 import com.dar.nbook.components.classes.CustomSSLSocketFactory;
 import com.dar.nbook.utility.LogUtility;

+ 80 - 0
app/src/main/java/com/dar/nbook/ui/theme/Theme.kt

@@ -0,0 +1,80 @@
+package com.dar.nbook.ui.theme
+
+import android.app.Activity
+import android.os.Build
+import androidx.compose.foundation.isSystemInDarkTheme
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.darkColorScheme
+import androidx.compose.material3.dynamicDarkColorScheme
+import androidx.compose.material3.dynamicLightColorScheme
+import androidx.compose.material3.lightColorScheme
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.SideEffect
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.toArgb
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.platform.LocalView
+import androidx.core.view.WindowCompat
+
+val Purple80 = Color(0xFFD0BCFF)
+val PurpleGrey80 = Color(0xFFCCC2DC)
+val Pink80 = Color(0xFFEFB8C8)
+
+val Purple40 = Color(0xFF6650a4)
+val PurpleGrey40 = Color(0xFF625b71)
+val Pink40 = Color(0xFF7D5260)
+
+private val DarkColorScheme = darkColorScheme(
+    primary = Purple80,
+    secondary = PurpleGrey80,
+    tertiary = Pink80,
+    surfaceTint = Color(0xFF1C1B1F),
+)
+
+private val LightColorScheme = lightColorScheme(
+    primary = Purple40,
+    secondary = PurpleGrey40,
+    tertiary = Pink40
+
+    /* Other default colors to override
+    background = Color(0xFFFFFBFE),
+    surface = Color(0xFFFFFBFE),
+    onPrimary = Color.White,
+    onSecondary = Color.White,
+    onTertiary = Color.White,
+    onBackground = Color(0xFF1C1B1F),
+    onSurface = Color(0xFF1C1B1F),
+    */
+)
+
+@Composable
+fun NClientV2Theme(
+    darkTheme: Boolean = isSystemInDarkTheme(),
+    // Dynamic color is available on Android 12+
+    dynamicColor: Boolean = true,
+    content: @Composable () -> Unit
+) {
+    val colorScheme = when {
+        dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
+            val context = LocalContext.current
+            if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
+        }
+
+        darkTheme -> DarkColorScheme
+        else -> LightColorScheme
+    }
+    val view = LocalView.current
+    if (!view.isInEditMode) {
+        SideEffect {
+            val window = (view.context as Activity).window
+            window.statusBarColor = colorScheme.primary.toArgb()
+            WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
+        }
+    }
+
+    MaterialTheme(
+        colorScheme = colorScheme,
+        typography = Typography,
+        content = content,
+    )
+}

+ 34 - 0
app/src/main/java/com/dar/nbook/ui/theme/Type.kt

@@ -0,0 +1,34 @@
+package com.dar.nbook.ui.theme
+
+import androidx.compose.material3.Typography
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.text.font.FontFamily
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.unit.sp
+
+// Set of Material typography styles to start with
+val Typography = Typography(
+    bodyLarge = TextStyle(
+        fontFamily = FontFamily.Default,
+        fontWeight = FontWeight.Normal,
+        fontSize = 16.sp,
+        lineHeight = 24.sp,
+        letterSpacing = 0.5.sp
+    )
+    /* Other default text styles to override
+    titleLarge = TextStyle(
+        fontFamily = FontFamily.Default,
+        fontWeight = FontWeight.Normal,
+        fontSize = 22.sp,
+        lineHeight = 28.sp,
+        letterSpacing = 0.sp
+    ),
+    labelSmall = TextStyle(
+        fontFamily = FontFamily.Default,
+        fontWeight = FontWeight.Medium,
+        fontSize = 11.sp,
+        lineHeight = 16.sp,
+        letterSpacing = 0.5.sp
+    )
+    */
+)

+ 24 - 0
app/src/main/res/layout/activity_blogin.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".BLoginActivity">
+
+    <com.google.android.material.textfield.TextInputLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="16dp"
+        android:layout_marginEnd="16dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <com.google.android.material.textfield.TextInputEditText
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:hint="Floating Hint Enabled Default" />
+    </com.google.android.material.textfield.TextInputLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -398,5 +398,6 @@
         <item>japanese</item>
         <item>pretty</item>
     </string-array>
+    <string name="title_activity_nlogin">NLoginActivity</string>
 
 </resources>

+ 5 - 1
build.gradle

@@ -8,10 +8,14 @@ buildscript {
     }
     dependencies {
         classpath 'com.android.tools.build:gradle:7.4.0'
+        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
     }
+    ext {
+        kotlin_version = '1.8.10'
+    }
 }
 
 allprojects {
@@ -23,7 +27,7 @@ allprojects {
     }
     gradle.projectsEvaluated {
         tasks.withType(JavaCompile) {
-            options.compilerArgs << "-Xlint:deprecation"
+            options.compilerArgs << "-Xlint:-deprecation"
         }
     }
 }