Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Final Touches
  • Loading branch information
dragosholban committed Mar 18, 2018
1 parent 6cb7f73 commit bc9fa1c
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Expand Up @@ -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>
Expand Up @@ -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"));

Expand Down
Binary file added app/src/main/res/drawable-hdpi/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-ldpi/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-mdpi/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xhdpi/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxhdpi/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable-xxxhdpi/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions app/src/main/res/layout/activity_main.xml
Expand Up @@ -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.