Permalink
Browse files

Final Touches

  • Loading branch information...
dragosholban committed Mar 18, 2018
1 parent 6cb7f73 commit bc9fa1c3e30160121554c3e60878925aad84ec70
@@ -40,7 +40,9 @@
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<activity android:name=".ImagesActivity"></activity>
<activity
android:name=".ImagesActivity"
android:screenOrientation="portrait" />
</application>
</manifest>
@@ -26,6 +26,14 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
boolean loggedIn = AccessToken.getCurrentAccessToken() != null;
if (loggedIn) {
Intent intent = new Intent(this, ImagesActivity.class);
this.startActivity(intent);
return;
}
LoginButton loginButton = findViewById(R.id.login_button);
loginButton.setReadPermissions(Arrays.asList("user_photos"));
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,13 +6,42 @@
android:layout_height="match_parent"
tools:context="dragosholban.com.bestphotos.MainActivity">
<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/background" />
<com.facebook.login.widget.LoginButton
android:id="@+id/login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:paddingTop="15dp"
android:paddingBottom="15dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"/>
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:lineSpacingExtra="8sp"
android:padding="16dp"
android:text="Please connect using your Facebook account so we can access your photos and show you the best ones."
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>

0 comments on commit bc9fa1c

Please sign in to comment.