mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-19 19:28:26 +00:00
Update registration activity style
// FREEBIE
This commit is contained in:
parent
ad0f2830c8
commit
3aae86d20c
BIN
res/drawable-hdpi/ic_info_white_18dp.png
Normal file
BIN
res/drawable-hdpi/ic_info_white_18dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 295 B |
BIN
res/drawable-mdpi/ic_info_white_18dp.png
Normal file
BIN
res/drawable-mdpi/ic_info_white_18dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 214 B |
BIN
res/drawable-xhdpi/ic_info_white_18dp.png
Normal file
BIN
res/drawable-xhdpi/ic_info_white_18dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 340 B |
BIN
res/drawable-xxhdpi/ic_info_white_18dp.png
Normal file
BIN
res/drawable-xxhdpi/ic_info_white_18dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 504 B |
BIN
res/drawable-xxxhdpi/ic_info_white_18dp.png
Normal file
BIN
res/drawable-xxxhdpi/ic_info_white_18dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 616 B |
20
res/drawable/pill_button.xml
Normal file
20
res/drawable/pill_button.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="30dp"
|
||||
android:bottomRightRadius="30dp"
|
||||
android:radius="60dp"
|
||||
android:topLeftRadius="30dp"
|
||||
android:topRightRadius="30dp" />
|
||||
|
||||
<solid android:color="#ffffff" />
|
||||
|
||||
<padding
|
||||
android:bottom="0dp"
|
||||
android:left="0dp"
|
||||
android:right="0dp"
|
||||
android:top="0dp" />
|
||||
|
||||
</shape>
|
@ -8,28 +8,17 @@
|
||||
|
||||
<LinearLayout android:padding="16dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView style="@style/Registration.Label"
|
||||
android:layout_width="fill_parent"
|
||||
android:gravity="start"
|
||||
android:textAllCaps="true"
|
||||
android:text="@string/registration_activity__your_country" />
|
||||
|
||||
<Spinner android:id="@+id/country_spinner"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dip" />
|
||||
|
||||
<TextView style="@style/Registration.Label"
|
||||
android:layout_width="fill_parent"
|
||||
android:gravity="start"
|
||||
android:textAllCaps="true"
|
||||
android:text="@string/registration_activity__your_country_code_and_phone_number" />
|
||||
|
||||
<LinearLayout android:orientation="horizontal"
|
||||
android:layoutDirection="ltr"
|
||||
android:layout_width="fill_parent"
|
||||
@ -69,11 +58,37 @@
|
||||
android:text="@string/registration_activity__verify_your_number_to_connect_with_signal"/>
|
||||
|
||||
<TextView style="@style/Registration.Description"
|
||||
android:id="@+id/registration_information"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_marginBottom="16dip"
|
||||
android:gravity="start"
|
||||
android:visibility="gone"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/registration_activity__registration_will_transmit_some_contact_information_to_the_server_temporariliy"/>
|
||||
|
||||
<LinearLayout android:id="@+id/information_link_container"
|
||||
android:clickable="true"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dip">
|
||||
|
||||
<ImageView android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:src="@drawable/ic_info_white_18dp"
|
||||
android:tint="#73B7F0"/>
|
||||
|
||||
<TextView style="@style/Registration.Description"
|
||||
android:id="@+id/information_label"
|
||||
android:clickable="false"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="#73B7F0"
|
||||
android:text="@string/RegistrationActivity_more_information"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dip"
|
||||
@ -81,21 +96,35 @@
|
||||
android:layout_gravity="right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button android:id="@+id/skipButton"
|
||||
android:visibility="gone"
|
||||
<TextView android:id="@+id/skipButton"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingBottom="15dp"
|
||||
android:text="@android:string/cancel"
|
||||
android:textColor="@color/white"
|
||||
android:background="@drawable/pill_button"
|
||||
android:backgroundTint="@color/grey_400"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginRight="5dip"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<Button android:id="@+id/registerButton"
|
||||
<TextView android:id="@+id/registerButton"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingBottom="15dp"
|
||||
android:text="@string/registration_activity__register"
|
||||
android:textColor="@color/white"
|
||||
android:background="@drawable/pill_button"
|
||||
android:backgroundTint="@color/signal_primary"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView android:id="@+id/twilio_shoutout"
|
||||
|
@ -251,6 +251,9 @@
|
||||
<string name="DeviceListItem_last_active_s">Last active %s</string>
|
||||
<string name="DeviceListItem_today">Today</string>
|
||||
|
||||
<!-- DocumentView -->
|
||||
<string name="DocumentView_unknown_file">unknown file</string>
|
||||
|
||||
<!-- DozeReminder -->
|
||||
<string name="DozeReminder_optimize_for_missing_play_services">Optimize for missing Play Services</string>
|
||||
<string name="DozeReminder_this_device_does_not_support_play_services_tap_to_disable_system_battery">This device does not support Play Services. Tap to disable system battery optimizations that prevent Signal from retrieving messages while inactive.</string>
|
||||
@ -526,6 +529,8 @@
|
||||
<string name="RegistrationActivity_i_understand">I understand</string>
|
||||
<string name="RegistrationActivity_play_services_error">Play Services Error</string>
|
||||
<string name="RegistrationActivity_google_play_services_is_updating_or_unavailable">Google Play Services is updating or temporarily unavailable. Please try again.</string>
|
||||
<string name="RegistrationActivity_more_information">More information</string>
|
||||
<string name="RegistrationActivity_less_information">Less information</string>
|
||||
|
||||
<!-- RegistrationProblemsActivity -->
|
||||
<string name="RegistrationProblemsActivity_possible_problems">Possible problems</string>
|
||||
@ -676,6 +681,9 @@
|
||||
<string name="QuickResponseService_quick_response_unavailable_when_Signal_is_locked">Quick response unavailable when Signal is locked!</string>
|
||||
<string name="QuickResponseService_problem_sending_message">Problem sending message!</string>
|
||||
|
||||
<!-- SaveAttachmentTask -->
|
||||
<string name="SaveAttachmentTask_open_directory">Open Directory</string>
|
||||
|
||||
<!-- SingleRecipientNotificationBuilder -->
|
||||
<string name="SingleRecipientNotificationBuilder_signal">Signal</string>
|
||||
<string name="SingleRecipientNotificationBuilder_new_message">New message</string>
|
||||
@ -931,7 +939,7 @@
|
||||
</string>
|
||||
<string name="registration_activity__phone_number">PHONE NUMBER</string>
|
||||
<string name="registration_activity__register">Register</string>
|
||||
<string name="registration_activity__registration_will_transmit_some_contact_information_to_the_server_temporariliy">Registration transmits some contact information to the server. It is not stored.</string>
|
||||
<string name="registration_activity__registration_will_transmit_some_contact_information_to_the_server_temporariliy">Signal makes it easy to communicate by using your existing phone number and address book. Friends and contacts who already know how to contact you by phone will be able to easily get in touch by Signal.\n\nRegistration transmits some contact information to the server. It is not stored.</string>
|
||||
<string name="registration_activity__powered_by_twilio">Powered by twilio</string>
|
||||
|
||||
<!-- registration_problems -->
|
||||
@ -1344,8 +1352,6 @@
|
||||
|
||||
<!-- transport_selection_list_item -->
|
||||
<string name="transport_selection_list_item__transport_icon">Transport icon</string>
|
||||
<string name="SaveAttachmentTask_open_directory">Open Directory</string>
|
||||
<string name="DocumentView_unknown_file">unknown file</string>
|
||||
|
||||
<!-- EOF -->
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
@ -15,14 +14,12 @@ import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
||||
import com.google.i18n.phonenumbers.AsYouTypeFormatter;
|
||||
import com.google.i18n.phonenumbers.NumberParseException;
|
||||
import com.google.i18n.phonenumbers.PhoneNumberUtil;
|
||||
@ -58,8 +55,11 @@ public class RegistrationActivity extends BaseActionBarActivity {
|
||||
private Spinner countrySpinner;
|
||||
private TextView countryCode;
|
||||
private TextView number;
|
||||
private Button createButton;
|
||||
private Button skipButton;
|
||||
private TextView createButton;
|
||||
private TextView skipButton;
|
||||
private TextView informationView;
|
||||
private View informationToggle;
|
||||
private TextView informationToggleText;
|
||||
|
||||
private MasterSecret masterSecret;
|
||||
|
||||
@ -86,37 +86,29 @@ public class RegistrationActivity extends BaseActionBarActivity {
|
||||
|
||||
private void initializeResources() {
|
||||
this.masterSecret = getIntent().getParcelableExtra("master_secret");
|
||||
this.countrySpinner = (Spinner)findViewById(R.id.country_spinner);
|
||||
this.countryCode = (TextView)findViewById(R.id.country_code);
|
||||
this.number = (TextView)findViewById(R.id.number);
|
||||
this.createButton = (Button)findViewById(R.id.registerButton);
|
||||
this.skipButton = (Button)findViewById(R.id.skipButton);
|
||||
this.countrySpinner = (Spinner) findViewById(R.id.country_spinner);
|
||||
this.countryCode = (TextView) findViewById(R.id.country_code);
|
||||
this.number = (TextView) findViewById(R.id.number);
|
||||
this.createButton = (TextView) findViewById(R.id.registerButton);
|
||||
this.skipButton = (TextView) findViewById(R.id.skipButton);
|
||||
this.informationView = (TextView) findViewById(R.id.registration_information);
|
||||
this.informationToggle = findViewById(R.id.information_link_container);
|
||||
this.informationToggleText = (TextView) findViewById(R.id.information_label);
|
||||
|
||||
DrawableCompat.setTint(this.createButton.getBackground(), getResources().getColor(R.color.signal_primary));
|
||||
DrawableCompat.setTint(this.skipButton.getBackground(), getResources().getColor(R.color.grey_400));
|
||||
|
||||
this.countryCode.addTextChangedListener(new CountryCodeChangedListener());
|
||||
this.number.addTextChangedListener(new NumberChangedListener());
|
||||
this.createButton.setOnClickListener(new CreateButtonListener());
|
||||
this.skipButton.setOnClickListener(new CancelButtonListener());
|
||||
this.informationToggle.setOnClickListener(new InformationToggleListener());
|
||||
|
||||
if (getIntent().getBooleanExtra("cancel_button", false)) {
|
||||
this.skipButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
this.skipButton.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
findViewById(R.id.twilio_shoutout).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.addCategory(Intent.CATEGORY_BROWSABLE);
|
||||
intent.setData(Uri.parse("https://twilio.com"));
|
||||
try {
|
||||
startActivity(intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Log.w(TAG,e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initializeSpinner() {
|
||||
@ -374,4 +366,17 @@ public class RegistrationActivity extends BaseActionBarActivity {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
private class InformationToggleListener implements View.OnClickListener {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (informationView.getVisibility() == View.VISIBLE) {
|
||||
informationView.setVisibility(View.GONE);
|
||||
informationToggleText.setText(R.string.RegistrationActivity_more_information);
|
||||
} else {
|
||||
informationView.setVisibility(View.VISIBLE);
|
||||
informationToggleText.setText(R.string.RegistrationActivity_less_information);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user