diff --git a/app/app/build.gradle b/app/app/build.gradle index db0fac98..801e4b95 100644 --- a/app/app/build.gradle +++ b/app/app/build.gradle @@ -6,31 +6,35 @@ plugins { android { compileSdk 32 - def appVersionCode = Integer.valueOf(System.env.BUILD_NUMBER ?: 0) - defaultConfig { applicationId "me.rxresu.app" minSdk 21 targetSdk 32 + versionCode 2 versionName "1.0" - versionCode appVersionCode - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + resConfigs "en" } buildTypes { release { - minifyEnabled false + minifyEnabled true + shrinkResources true + zipAlignEnabled true + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + kotlinOptions { jvmTarget = '1.8' } + buildFeatures { viewBinding true } @@ -39,8 +43,4 @@ android { dependencies { implementation 'androidx.core:core-ktx:1.7.0' implementation 'com.google.android.material:material:1.5.0' - implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } diff --git a/app/app/src/main/java/me/rxresu/app/MainActivity.kt b/app/app/src/main/java/me/rxresu/app/MainActivity.kt index 24b47e9c..ba63ae56 100644 --- a/app/app/src/main/java/me/rxresu/app/MainActivity.kt +++ b/app/app/src/main/java/me/rxresu/app/MainActivity.kt @@ -9,15 +9,13 @@ import android.webkit.WebResourceRequest import android.webkit.WebView import android.webkit.WebViewClient import androidx.appcompat.app.AppCompatActivity -import androidx.swiperefreshlayout.widget.SwipeRefreshLayout class MainActivity : AppCompatActivity() { private lateinit var webView: WebView - private lateinit var swipeLayout: SwipeRefreshLayout private var isLoaded: Boolean = false - private var webURL = "https://beta.rxresu.me" + private var webURL = "https://rxresu.me" @SuppressLint("SetJavaScriptEnabled") override fun onCreate(savedInstanceState: Bundle?) { @@ -25,18 +23,9 @@ class MainActivity : AppCompatActivity() { setContentView(R.layout.activity_main) webView = findViewById(R.id.webview) - swipeLayout = findViewById(R.id.swipelayout) webView.settings.javaScriptEnabled = true webView.settings.userAgentString = "Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Mobile Safari/537.36" - - WebView.setWebContentsDebuggingEnabled(true) - - swipeLayout.setOnRefreshListener { - webView.reload() - - swipeLayout.isRefreshing = false - } } override fun onResume() { diff --git a/app/app/src/main/res/layout/content_main.xml b/app/app/src/main/res/layout/content_main.xml index 05951302..f4dc8711 100644 --- a/app/app/src/main/res/layout/content_main.xml +++ b/app/app/src/main/res/layout/content_main.xml @@ -1,8 +1,8 @@ - @@ -10,10 +10,9 @@ android:id="@+id/webview" android:layout_width="0dp" android:layout_height="0dp" - android:visibility="visible" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - +