Skip to content

Commit bc9fa1c

Browse files
committed
Final Touches
1 parent 6cb7f73 commit bc9fa1c

File tree

9 files changed

+40
-1
lines changed

9 files changed

+40
-1
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
<data android:scheme="@string/fb_login_protocol_scheme" />
4141
</intent-filter>
4242
</activity>
43-
<activity android:name=".ImagesActivity"></activity>
43+
<activity
44+
android:name=".ImagesActivity"
45+
android:screenOrientation="portrait" />
4446
</application>
4547

4648
</manifest>

app/src/main/java/dragosholban/com/bestphotos/MainActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ protected void onCreate(Bundle savedInstanceState) {
2626
super.onCreate(savedInstanceState);
2727
setContentView(R.layout.activity_main);
2828

29+
boolean loggedIn = AccessToken.getCurrentAccessToken() != null;
30+
if (loggedIn) {
31+
Intent intent = new Intent(this, ImagesActivity.class);
32+
this.startActivity(intent);
33+
34+
return;
35+
}
36+
2937
LoginButton loginButton = findViewById(R.id.login_button);
3038
loginButton.setReadPermissions(Arrays.asList("user_photos"));
3139

249 KB
Loading
77.8 KB
Loading
127 KB
Loading
396 KB
Loading
Loading
1.03 MB
Loading

app/src/main/res/layout/activity_main.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,42 @@
66
android:layout_height="match_parent"
77
tools:context="dragosholban.com.bestphotos.MainActivity">
88

9+
<ImageView
10+
android:layout_width="0dp"
11+
android:layout_height="0dp"
12+
android:scaleType="centerCrop"
13+
app:layout_constraintBottom_toBottomOf="parent"
14+
app:layout_constraintEnd_toEndOf="parent"
15+
app:layout_constraintStart_toStartOf="parent"
16+
app:layout_constraintTop_toTopOf="parent"
17+
app:srcCompat="@drawable/background" />
18+
919
<com.facebook.login.widget.LoginButton
1020
android:id="@+id/login_button"
1121
android:layout_width="wrap_content"
1222
android:layout_height="wrap_content"
1323
app:layout_constraintBottom_toBottomOf="parent"
1424
app:layout_constraintLeft_toLeftOf="parent"
1525
app:layout_constraintRight_toRightOf="parent"
26+
app:layout_constraintTop_toTopOf="parent"
27+
android:paddingTop="15dp"
28+
android:paddingBottom="15dp"
29+
android:paddingLeft="15dp"
30+
android:paddingRight="15dp"/>
31+
32+
<TextView
33+
android:id="@+id/textView2"
34+
android:layout_width="0dp"
35+
android:layout_height="wrap_content"
36+
android:layout_marginTop="16dp"
37+
android:lineSpacingExtra="8sp"
38+
android:padding="16dp"
39+
android:text="Please connect using your Facebook account so we can access your photos and show you the best ones."
40+
android:textAlignment="center"
41+
android:textColor="@android:color/white"
42+
android:textSize="18sp"
43+
app:layout_constraintLeft_toLeftOf="parent"
44+
app:layout_constraintRight_toRightOf="parent"
1645
app:layout_constraintTop_toTopOf="parent" />
1746

1847
</android.support.constraint.ConstraintLayout>

0 commit comments

Comments
 (0)