Skip to content

Commit

Permalink
Merge pull request #80 from ApplETS/revert-79-loginBg
Browse files Browse the repository at this point in the history
Revert "Fix login background"
  • Loading branch information
komlan55 authored May 23, 2017
2 parents ff00479 + 0837c43 commit ad024eb
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 85 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,6 @@ dependencies {
transitive = true
}
compile 'com.github.markushi:circlebutton:1.1'
compile 'com.flaviofaria:kenburnsview:1.0.7'


}
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,41 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.octo.android.robospice.persistence.exception.SpiceException;
import com.octo.android.robospice.request.listener.RequestListener;
import com.squareup.picasso.Picasso;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.IOException;
import java.net.URL;

import ca.etsmtl.applets.etsmobile.ApplicationManager;
import ca.etsmtl.applets.etsmobile.http.AuthentificationPortailTask;
import ca.etsmtl.applets.etsmobile.http.DataManager;
import ca.etsmtl.applets.etsmobile.model.Etudiant;
import ca.etsmtl.applets.etsmobile.model.UserCredentials;
import ca.etsmtl.applets.etsmobile.service.RegistrationIntentService;
import ca.etsmtl.applets.etsmobile.util.Constants;
import ca.etsmtl.applets.etsmobile.util.SecurePreferences;
import ca.etsmtl.applets.etsmobile.widget.TodayWidgetProvider;
import ca.etsmtl.applets.etsmobile2.R;

Expand All @@ -50,7 +61,6 @@ public class LoginActivity extends AccountAuthenticatorActivity implements Reque
private View mLoginFormView;
private View mLoginStatusView;
private TextView mLoginStatusMessageView;
private ProgressBar mLoginStatusProgressBar;

private DataManager dataManager;
private UserCredentials userCredentials;
Expand All @@ -66,8 +76,6 @@ protected void onCreate(Bundle savedInstanceState) {

setContentView(R.layout.activity_login);

setUpBackground();

accountManager = AccountManager.get(getBaseContext());

// Set up the login form.
Expand All @@ -90,9 +98,6 @@ public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
mLoginFormView = findViewById(R.id.login_form);
mLoginStatusView = findViewById(R.id.login_status);
mLoginStatusMessageView = (TextView) findViewById(R.id.login_status_message);
mLoginStatusProgressBar = (ProgressBar) findViewById(R.id.login_status_progress);
mLoginStatusProgressBar.getIndeterminateDrawable().setColorFilter(getResources().
getColor(R.color.white), android.graphics.PorterDuff.Mode.SRC_ATOP);

findViewById(R.id.sign_in_button).setOnClickListener(new View.OnClickListener() {
@Override
Expand All @@ -102,23 +107,6 @@ public void onClick(View view) {
});
}

private void setUpBackground() {
runOnUiThread(new Runnable() {
@Override
public void run() {
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int width = displayMetrics.widthPixels;
int height = displayMetrics.heightPixels;

ImageView bgEtsIv = (ImageView) findViewById(R.id.bg_image_view);

Picasso.with(getApplicationContext()).load(R.drawable.bg_ets).resize(width, height).
onlyScaleDown().centerCrop().into(bgEtsIv);
}
});
}

/**
* Attempts to sign in or register the account specified by the login form.
* If there are form errors (invalid email, missing fields, etc.), the
Expand Down
Binary file removed app/src/main/res/drawable/bg_ets.jpg
Binary file not shown.
99 changes: 51 additions & 48 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
xmlns:tools="http://schemas.android.com/tools"
tools:context=".LoginActivity" >

<include
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/bg_view"/>

<!-- Login progress -->

<LinearLayout
Expand All @@ -19,7 +14,6 @@
android:visibility="gone" >

<ProgressBar
android:id="@+id/login_status_progress"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -31,53 +25,62 @@
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="@string/login_progress_signing_in"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/white"/>
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<!-- android:fontFamily="sans-serif-light" -->
<!-- Login form -->

<LinearLayout
android:id="@+id/login_form"
style="@style/LoginFormContainer"
android:layout_gravity="top|center"
android:orientation="vertical" >
<!-- <ScrollView -->
<!-- android:id="@+id/login_form" -->
<!-- android:layout_width="match_parent" -->
<!-- android:layout_height="match_parent" > -->

<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_email"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:textColor="@android:color/white"
android:textColorHint="@android:color/white" />


<LinearLayout
android:id="@+id/login_form"
style="@style/LoginFormContainer"
android:layout_gravity="top|center"
android:background="@drawable/background_ets"
android:orientation="vertical" >

<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_password"
android:imeActionId="@+id/login"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true"
android:textColor="@android:color/white"
android:textColorHint="@android:color/white" />
<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_email"
android:inputType="text"
android:maxLines="1"
android:singleLine="true"
android:textColor="@android:color/white"
android:textColorHint="@android:color/white" />

<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_password"
android:imeActionId="@+id/login"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true"
android:textColor="@android:color/white"
android:textColorHint="@android:color/white" />

<Button
android:id="@+id/sign_in_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="16dp"
android:background="@android:color/transparent"
android:paddingLeft="32dp"
android:paddingRight="32dp"
android:text="@string/action_sign_in_register"
android:textColor="@android:color/white" />
</LinearLayout>
<!-- </ScrollView> -->

<Button
android:id="@+id/sign_in_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="16dp"
android:background="@android:color/transparent"
android:paddingLeft="32dp"
android:paddingRight="32dp"
android:text="@string/action_sign_in_register"
android:textColor="@android:color/white" />
</LinearLayout>
</merge>
8 changes: 0 additions & 8 deletions app/src/main/res/layout/bg_view.xml

This file was deleted.

0 comments on commit ad024eb

Please sign in to comment.