Skip to content

Commit 5650dd5

Browse files
committed
UI improvements, linter
Signed-off-by: rapterjet2004 <[email protected]>
1 parent a89d9af commit 5650dd5

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

app/src/main/java/com/nextcloud/talk/account/BrowserLoginActivity.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ import okhttp3.FormBody
5252
import okhttp3.OkHttpClient
5353
import okhttp3.Request
5454
import okhttp3.RequestBody
55+
import org.json.JSONException
5556
import org.json.JSONObject
5657
import java.io.IOException
5758
import java.util.concurrent.Executors
5859
import java.util.concurrent.ScheduledExecutorService
5960
import java.util.concurrent.TimeUnit
6061
import javax.inject.Inject
62+
import javax.net.ssl.SSLHandshakeException
6163
import javax.net.ssl.SSLSession
6264

6365
@AutoInjector(NextcloudTalkApplication::class)
@@ -150,8 +152,8 @@ class BrowserLoginActivity : BaseActivity() {
150152
launchDefaultWebBrowser(loginUrl)
151153
}
152154
token = jsonObject.getAsJsonObject("poll").get("token").asString
153-
} catch (e: Exception) {
154-
Log.d(TAG, "Error caught at anonymouslyPostLoginRequest: $e")
155+
} catch (e: SSLHandshakeException) {
156+
Log.e(TAG, "Error caught at anonymouslyPostLoginRequest: $e")
155157
}
156158
}
157159
}
@@ -229,8 +231,8 @@ class BrowserLoginActivity : BaseActivity() {
229231
runOnUiThread { completeLoginFlow(response, status) }
230232
}
231233
}
232-
} catch (e: Exception) {
233-
Log.d(TAG, "Error caught at performLoginFlowV2: $e")
234+
} catch (e: IllegalStateException) {
235+
Log.e(TAG, "Error caught at performLoginFlowV2: $e")
234236
}
235237
}
236238

@@ -251,8 +253,8 @@ class BrowserLoginActivity : BaseActivity() {
251253
(status == HTTP_OK && !server.isEmpty() && !loginName.isEmpty() && !appPassword.isEmpty())
252254

253255
parseAndLogin(loginData)
254-
} catch (e: java.lang.Exception) {
255-
Log.d(TAG, "Error caught at completeLoginFlow: $e")
256+
} catch (e: JSONException) {
257+
Log.e(TAG, "Error caught at completeLoginFlow: $e")
256258
}
257259

258260
loginFlowExecutorService?.shutdown()

app/src/main/res/layout/activity_web_view_login.xml

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,16 @@
33
~ Nextcloud Talk - Android Client
44
~
55
~ SPDX-FileCopyrightText: 2017 Mario Danic <[email protected]>
6+
~ SPDX-FileCopyrightText: 2025 Julius Linus <[email protected]>
67
~ SPDX-License-Identifier: GPL-3.0-or-later
78
-->
8-
<RelativeLayout
9-
xmlns:android="http://schemas.android.com/apk/res/android"
10-
xmlns:app="http://schemas.android.com/apk/res-auto"
9+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
1110
android:layout_width="match_parent"
1211
android:layout_height="match_parent"
1312
android:background="@color/colorPrimary"
1413
android:keepScreenOn="true"
1514
android:orientation="vertical">
1615

17-
<ImageView
18-
android:id="@+id/image_logo"
19-
android:layout_width="match_parent"
20-
android:layout_height="96dp"
21-
android:layout_marginHorizontal="@dimen/standard_margin"
22-
android:layout_marginTop="185dp"
23-
android:contentDescription="@string/nc_app_product_name"
24-
android:scaleType="centerInside"
25-
app:srcCompat="@drawable/ic_logo" />
26-
2716
<com.google.android.material.progressindicator.CircularProgressIndicator
2817
android:id="@+id/progress_bar"
2918
android:layout_width="@dimen/item_height"
@@ -37,25 +26,33 @@
3726
android:indeterminateTint="@color/white"
3827
android:indeterminateTintMode="src_in" />
3928

40-
<com.google.android.material.textview.MaterialTextView
41-
android:id="@+id/cancel_desc"
42-
android:layout_width="wrap_content"
29+
<LinearLayout
30+
android:layout_width="match_parent"
4331
android:layout_height="wrap_content"
44-
android:layout_below="@id/progress_bar"
45-
android:layout_marginTop="@dimen/standard_double_margin"
46-
android:textAlignment="center"
47-
android:text="@string/please_continue_the_login_process_in_the_browser"
48-
android:layout_centerInParent="true"/>
32+
android:layout_marginBottom="@dimen/standard_double_margin"
33+
android:orientation="vertical"
34+
android:layout_alignParentBottom="true">
4935

36+
<com.google.android.material.textview.MaterialTextView
37+
android:id="@+id/cancel_desc"
38+
android:layout_width="wrap_content"
39+
android:layout_height="wrap_content"
40+
android:layout_marginTop="@dimen/standard_double_margin"
41+
android:textAlignment="center"
42+
android:layout_gravity="center"
43+
android:textSize="@dimen/headline_text_size"
44+
android:textColor="@color/white"
45+
android:text="@string/please_continue_the_login_process_in_the_browser"
46+
/>
5047

51-
<com.google.android.material.button.MaterialButton
52-
android:id="@+id/cancel_login_btn"
53-
android:layout_width="wrap_content"
54-
android:layout_height="wrap_content"
55-
android:layout_below="@id/cancel_desc"
56-
android:layout_marginTop="@dimen/standard_double_margin"
57-
android:layout_centerInParent="true"
58-
android:text="@string/cancel_login"
59-
/>
48+
<com.google.android.material.button.MaterialButton
49+
android:id="@+id/cancel_login_btn"
50+
android:layout_width="300dp"
51+
android:layout_height="wrap_content"
52+
android:layout_gravity="center"
53+
android:layout_marginTop="@dimen/standard_double_margin"
54+
android:text="@string/cancel_login"
55+
/>
56+
</LinearLayout>
6057

6158
</RelativeLayout>

0 commit comments

Comments
 (0)