Skip to content
Snippets Groups Projects
Commit a1a590bf authored by Jawnnypoo's avatar Jawnnypoo
Browse files

Accept any exception when fetching accounts from prefs of widgets

parent 7f5fdc6d
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
Loading
@@ -75,8 +75,7 @@ class LoginActivity : BaseActivity() {
 
@BindView(R.id.root) lateinit var root: View
@BindView(R.id.toolbar) lateinit var toolbar: Toolbar
@BindView(R.id.url_hint) lateinit var textInputLayoutUrl: TextInputLayout
@BindView(R.id.url_input) lateinit var textUrl: TextView
@BindView(R.id.text_input_layout_server) lateinit var textInputLayoutUrl: TextInputLayout
@BindView(R.id.user_input_hint) lateinit var textInputLayoutUser: TextInputLayout
@BindView(R.id.user_input) lateinit var textUser: EditText
@BindView(R.id.password_hint) lateinit var textInputLayoutPassword: TextInputLayout
Loading
Loading
@@ -197,7 +196,7 @@ class LoginActivity : BaseActivity() {
toolbar.setNavigationOnClickListener { onBackPressed() }
}
 
textUrl.setText(R.string.url_gitlab)
textInputLayoutUrl.editText?.setText(R.string.url_gitlab)
}
 
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
Loading
Loading
@@ -292,7 +291,7 @@ class LoginActivity : BaseActivity() {
}
 
fun verifyUrl(): Boolean {
val url = textUrl.text.toString()
val url = textInputLayoutUrl.text()
var uri: Uri? = null
try {
if (HttpUrl.parse(url) != null) {
Loading
Loading
Loading
Loading
@@ -26,7 +26,7 @@ object ProjectFeedWidgetPrefs {
try {
val adapter = MoshiProvider.moshi.adapter<Account>(Account::class.java)
return adapter.fromJson(accountsJson)
} catch (e: IOException) {
} catch (e: Exception) {
//why would this ever happen?!?!?1
getSharedPrefs(context).edit().remove(widgetId.toString() + KEY_ACCOUNT).commit()
}
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ object UserFeedWidgetPrefs {
try {
val adapter = MoshiProvider.moshi.adapter<Account>(Account::class.java)
return adapter.fromJson(accountsJson)
} catch (e: IOException) {
} catch (e: Exception) {
//why would this ever happen?!?!?1
getSharedPrefs(context).edit().remove(widgetId.toString() + KEY_ACCOUNT).commit()
}
Loading
Loading
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/root"
android:layout_width="match_parent"
Loading
Loading
@@ -9,7 +10,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="0dp" />
android:elevation="0dp"/>
 
<ImageView
android:layout_width="wrap_content"
Loading
Loading
@@ -17,7 +18,7 @@
android:layout_gravity="center_horizontal"
android:layout_marginTop="32dp"
android:contentDescription="@string/app_name"
app:srcCompat="@drawable/ic_logo" />
app:srcCompat="@drawable/ic_logo"/>
 
<LinearLayout
android:layout_width="match_parent"
Loading
Loading
@@ -28,18 +29,16 @@
android:orientation="vertical">
 
<android.support.design.widget.TextInputLayout
android:id="@+id/url_hint"
android:id="@+id/text_input_layout_server"
android:layout_width="match_parent"
android:layout_height="wrap_content">
 
<android.support.design.widget.TextInputEditText
android:id="@+id/url_input"
android:id="@+id/text_server"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:layout_centerHorizontal="true"
android:hint="@string/url_hint"
android:inputType="textUri" />
android:inputType="textUri"/>
 
</android.support.design.widget.TextInputLayout>
 
Loading
Loading
@@ -61,7 +60,7 @@
android:layout_alignParentTop="true"
android:hint="@string/user_hint"
android:imeOptions="actionNext"
android:inputType="textEmailAddress" />
android:inputType="textEmailAddress"/>
 
</android.support.design.widget.TextInputLayout>
 
Loading
Loading
@@ -77,7 +76,7 @@
android:layout_below="@+id/user_input"
android:layout_centerHorizontal="true"
android:hint="@string/password_hint"
android:inputType="textPassword" />
android:inputType="textPassword"/>
 
</android.support.design.widget.TextInputLayout>
</LinearLayout>
Loading
Loading
@@ -101,34 +100,34 @@
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:hint="@string/token_hint"
android:inputType="textVisiblePassword" />
android:inputType="textVisiblePassword"/>
</android.support.design.widget.TextInputLayout>
 
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/or" />
android:text="@string/or"/>
 
<Button
android:id="@+id/button_open_login_page"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/open_login_page" />
android:text="@string/open_login_page"/>
 
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/or" />
android:text="@string/or"/>
 
<Button
android:id="@+id/button_open_login_page_for_personal_access"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/open_login_page_for_personal_access_token" />
android:text="@string/open_login_page_for_personal_access_token"/>
</LinearLayout>
 
</LinearLayout>
Loading
Loading
@@ -139,8 +138,8 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="16dp"
android:text="@string/login_button" />
android:text="@string/login_button"/>
 
<include layout="@layout/progress_fullscreen" />
<include layout="@layout/progress_fullscreen"/>
 
</FrameLayout>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment