mirror of
https://github.com/oxen-io/session-android.git
synced 2023-12-14 02:53:01 +01:00
turn RegistrationProblemsActivity into a dialog
// FREEBIE
This commit is contained in:
parent
720521d020
commit
fab2296927
4 changed files with 93 additions and 150 deletions
|
@ -50,10 +50,6 @@
|
|||
<meta-data android:name="org.thoughtcrime.securesms.mms.TextSecureGlideModule"
|
||||
android:value="GlideModule" />
|
||||
|
||||
<activity android:name=".RegistrationProblemsActivity"
|
||||
android:theme="@style/Theme.AppCompat.Light.DialogWhenLarge"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".CountrySelectionActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
|
|
|
@ -1,140 +1,107 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dip"
|
||||
android:paddingRight="10dip"
|
||||
android:baselineAligned="false">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ScrollView android:layout_alignParentTop="true"
|
||||
android:layout_above="@+id/button_frame"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:paddingTop="5dip"
|
||||
android:paddingBottom="12dip">
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dip"
|
||||
android:text="@string/registration_problems__some_possible_problems_include" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TableLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dip"
|
||||
android:text="@string/registration_problems__some_possible_problems_include" />
|
||||
android:paddingRight="10dip"
|
||||
android:text="•" />
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TableRow>
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/registration_problems__sms_interceptors"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="10dip"
|
||||
android:text="•" />
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="10dip"
|
||||
android:text="@string/registration_problems__some_third_party_text_messaging_clients_such_as_handcent" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/registration_problems__sms_interceptors"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="10dip"
|
||||
android:text="•" />
|
||||
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="10dip"
|
||||
android:text="@string/registration_problems__some_third_party_text_messaging_clients_such_as_handcent" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TableRow>
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/registration_problems__incorrect_number"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="10dip"
|
||||
android:text="•" />
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="10dip"
|
||||
android:text="@string/registration_problems__please_checkt_to_make_sure_you_entered_your_number_correctly" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
<TableRow>
|
||||
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/registration_problems__incorrect_number"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="•" />
|
||||
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="10dip"
|
||||
android:text="@string/registration_problems__please_checkt_to_make_sure_you_entered_your_number_correctly" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TableRow>
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/registration_problems__google_voice"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="•" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/registration_problems__google_voice"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="10dip"
|
||||
android:text="@string/registration_problems__textsecure_will_not_work_with_google_voice_numbers" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<LinearLayout android:id="@+id/button_frame"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="54dip"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<Button android:id="@+id/close_button"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dip"
|
||||
android:paddingRight="10dip"
|
||||
android:text="@android:string/ok"/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
style="@style/Registration.Description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="10dip"
|
||||
android:text="@string/registration_problems__textsecure_will_not_work_with_google_voice_numbers" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.ActionBarActivity;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
|
||||
public class RegistrationProblemsActivity extends BaseActionBarActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
setContentView(R.layout.registration_problems);
|
||||
setTitle(getString(R.string.RegistrationProblemsActivity_possible_problems));
|
||||
|
||||
((Button)findViewById(R.id.close_button)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -31,6 +31,8 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
|
||||
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||||
import org.thoughtcrime.securesms.push.TextSecureCommunicationFactory;
|
||||
import org.thoughtcrime.securesms.service.KeyCachingService;
|
||||
|
@ -171,9 +173,11 @@ public class RegistrationProgressActivity extends BaseActionBarActivity {
|
|||
spannableString.setSpan(new ClickableSpan() {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
Intent intent = new Intent(RegistrationProgressActivity.this,
|
||||
RegistrationProblemsActivity.class);
|
||||
startActivity(intent);
|
||||
new MaterialDialog.Builder(RegistrationProgressActivity.this)
|
||||
.title(R.string.RegistrationProblemsActivity_possible_problems)
|
||||
.customView(R.layout.registration_problems, true)
|
||||
.neutralText(android.R.string.ok)
|
||||
.show();
|
||||
}
|
||||
}, pretext.length() + 1, spannableString.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue