Skip to content

Commit

Permalink
Merge pull request #51 from mnprtpsingh/master
Browse files Browse the repository at this point in the history
Login Activity Modified
  • Loading branch information
RamolaWeb authored Mar 13, 2017
2 parents 0499b87 + ddf1ba8 commit 3c95886
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 72 deletions.
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ dependencies {
compile 'com.cloudinary:cloudinary-android:1.2.2'
compile 'com.android.support:palette-v7:25.0.1'

compile 'net.steamcrafted:load-toast:1.0.10'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.github.florent37:materialleanback:1.0.2'
compile 'com.nineoldandroids:library:2.4.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
import com.nith.appteam.nimbus.R;
import com.nith.appteam.nimbus.Utils.SharedPref;

import static com.nith.appteam.nimbus.R.id.tvSkip;

public class LoginActivity extends AppCompatActivity {

private TextView tvSkip;
private SharedPref sharedPref;

@Override
Expand All @@ -27,17 +28,5 @@ protected void onCreate(Bundle savedInstanceState) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_login);

tvSkip = (TextView)findViewById(R.id.tvSkip);

tvSkip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sharedPref.setSkipStatus(true);
sharedPref.setLoginStatus(false);
startActivity(new Intent(LoginActivity.this,MainActivity.class));
finish();
}
});

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.facebook.CallbackManager;
Expand All @@ -20,6 +21,7 @@
import com.facebook.login.LoginResult;
import com.facebook.login.widget.LoginButton;
import com.google.gson.annotations.SerializedName;
import com.nith.appteam.nimbus.Activity.LoginActivity;
import com.nith.appteam.nimbus.Activity.MainActivity;
import com.nith.appteam.nimbus.R;
import com.nith.appteam.nimbus.Utils.SharedPref;
Expand All @@ -41,6 +43,7 @@
public class FbLoginFragment extends Fragment {

private LoginButton btnLogin;
private TextView tvSkip;
private SharedPref sharedPref;
private ArrayList<String> permissions;
private CallbackManager callbackManager;
Expand Down Expand Up @@ -71,6 +74,16 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
pbLogin = (ProgressBar)view.findViewById(R.id.pbLogin);
btnLogin.setFragment(this);

tvSkip = (TextView)view.findViewById(R.id.tvSkip);

tvSkip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
sharedPref.setSkipStatus(true);
startActivity(new Intent(getContext(), MainActivity.class));
}
});

permissions = new ArrayList<>();
permissions.add("email");
btnLogin.setReadPermissions(permissions);
Expand Down
Binary file added app/src/main/res/drawable/ic_skip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 1 addition & 26 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.nith.appteam.nimbus.Activity.LoginActivity">

<fragment
Expand All @@ -16,25 +12,4 @@
android:id="@+id/fragmentLogin"
android:name="com.nith.appteam.nimbus.Fragment.FbLoginFragment"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:text="SKIP"
android:textStyle="bold"
android:textSize="15sp"
android:textColor="#fff"
android:id="@+id/tvSkip"
android:layout_centerHorizontal="true"
android:layout_below="@+id/btnLogin"
android:layout_marginBottom="12dp"
android:layout_gravity="bottom|center_horizontal"
android:paddingLeft="45dp"
android:paddingRight="45dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:gravity="center"
android:background="#4e000000"
/>

</FrameLayout>
</FrameLayout>
76 changes: 46 additions & 30 deletions app/src/main/res/layout/fragment_fblogin.xml
Original file line number Diff line number Diff line change
@@ -1,35 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:layout_width="220dp"
android:layout_height="220dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:src="@drawable/nimbuslogo"
android:id="@+id/ivAppLogo"
/>
<ImageView
android:id="@+id/ivAppLogo"
android:layout_width="320dp"
android:layout_height="320dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="54dp"
android:src="@drawable/nimbuslogo" />

<com.facebook.login.widget.LoginButton
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_below="@+id/ivAppLogo"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:textSize="15dp"
android:id="@+id/btnLogin"
android:layout_marginTop="50dp"/>
<ProgressBar
android:id="@+id/pbLogin"
android:layout_width="120dp"
android:layout_height="120dp"
android:visibility="gone"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="54dp" />

<ProgressBar
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_below="@+id/btnLogin"
android:layout_centerHorizontal="true"
android:layout_marginTop="100dp"
android:visibility="gone"
android:id="@+id/pbLogin"/>

</RelativeLayout>
<TextView
android:id="@+id/tvSkip"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/ic_skip"
android:gravity="center_vertical"
android:paddingLeft="12dp"
android:text="SKIP"
android:textSize="14dp"
android:textStyle="bold"
android:visibility="visible"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="8dp"
android:layout_marginRight="8dp"/>

<com.facebook.login.widget.LoginButton
android:id="@+id/btnLogin"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:paddingBottom="16dp"
android:paddingTop="16dp"
android:textSize="16dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="100dp" />

</RelativeLayout>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:2.3.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Fri Mar 03 19:49:20 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

0 comments on commit 3c95886

Please sign in to comment.