Skip to content
This repository has been archived by the owner on Oct 9, 2022. It is now read-only.

Commit

Permalink
Readiciona tela de login antiga temporariamente
Browse files Browse the repository at this point in the history
  • Loading branch information
BrenoFRocha committed Aug 3, 2018
1 parent 6558892 commit 682d131
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
21 changes: 19 additions & 2 deletions app/src/main/java/br/ufrj/caronae/acts/LoginAct.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public class LoginAct extends AppCompatActivity {
@BindView(R.id.idUfrj_et)
EditText idUfrj_et;

@BindView(R.id.key)
TextView getKey;

@BindView(R.id.send_bt)
Button loginButton;

Expand All @@ -62,8 +65,17 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_login);
ButterKnife.bind(this);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

if(!Constants.BUILD_TYPE.equals("prod"))
if(Constants.BUILD_TYPE.equals("prod"))
{
lBackV3.setVisibility(View.GONE);
rBackV3.setVisibility(View.GONE);
loginBtV3.setVisibility(View.GONE);
idUfrj_et.setVisibility(View.VISIBLE);
token_et.setVisibility(View.VISIBLE);
loginButton.setVisibility(View.VISIBLE);
getKey.setVisibility(View.VISIBLE);
}
else
{
lBackV3.setVisibility(View.GONE);
rBackV3.setVisibility(View.GONE);
Expand Down Expand Up @@ -213,4 +225,9 @@ public void loginV3()
{
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.API_BASE_URL + "login?type=app_jwt")));
}

@OnClick(R.id.key)
public void getTokenBt() {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(CaronaeAPI.BASE_URL + "login")));
}
}
17 changes: 16 additions & 1 deletion app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,27 @@
android:text="@string/welcome_message"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/key"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/textView2"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true"
android:gravity="center"
android:textColor="@android:color/holo_blue_dark"
android:textStyle="bold"
android:text="@string/prod_caronae_key"
android:textAppearance="?android:attr/textAppearanceMedium" />

<EditText
android:visibility="gone"
android:id="@+id/idUfrj_et"
android:layout_width="285dp"
android:layout_height="wrap_content"
android:layout_below="@id/textView2"
android:layout_below="@id/key"
android:layout_marginTop="25dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:ems="8"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
<string name="driver_message_uppercase">RECADO DO MOTORISTA</string>
<string name="reason_of_contact_uppercase">MOTIVO DO CONTATO</string>
<string name="reference_point_uppercase">PONTO DE REFERÊNCIA</string>
<string name="prod_caronae_key"><u>OBTENHA SUA CHAVE AQUI</u></string>

<!-- Messages -->
<string name="crash_notifcation_ticker_message">Caronaê parou</string>
Expand Down

0 comments on commit 682d131

Please sign in to comment.