Skip to content

Commit

Permalink
Updated me page ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl26 committed Mar 15, 2017
1 parent df49c39 commit 4565ea5
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@

import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TableRow;
import android.widget.Toast;
import android.support.v7.widget.Toolbar;

Expand All @@ -39,15 +37,14 @@

public class MeFragment extends Fragment {
private final String TAG = "MePage";
private Button myRatingsButton, myBookmarksButton, settingButton, logoutButton;
private TableRow myRatingsRow, myBookmarksRow, settingsRow, logoutRow;
private RequestHttpBuilderSingleton requestHttpBuilder = RequestHttpBuilderSingleton.getInstance();
private Gson gson = new Gson();
private MyTask myTask;
private ArrayList<Movie> movieList;
private File credential;
private View view;
private Toolbar tbMe;
private GlobalReceiver receiver;

public MeFragment() {
}
Expand All @@ -57,30 +54,30 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment_me, container, false);
bindViews(view);
myRatingsButton.setOnClickListener(new View.OnClickListener() {
myRatingsRow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
myTask = new MyTask();
myTask.execute("rating");
}
});
myBookmarksButton.setOnClickListener(new View.OnClickListener() {
myBookmarksRow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
myTask = new MyTask();
myTask.execute("bookmark");
}
});

logoutButton.setOnClickListener(new View.OnClickListener() {
logoutRow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.i(TAG, "Logout button pressed");
loggingOut();
}
});

settingButton.setOnClickListener(new View.OnClickListener() {
settingsRow.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
Expand Down Expand Up @@ -117,10 +114,10 @@ private void loggingOut() {
}

private void bindViews(View view){
myBookmarksButton = (Button)view.findViewById(R.id.button_my_bookmarks);
myRatingsButton = (Button)view.findViewById(R.id.button_my_rating);
logoutButton = (Button)view.findViewById(R.id.button_logout);
settingButton = (Button)view.findViewById(R.id.button_setting);
myBookmarksRow = (TableRow) view.findViewById(R.id.me_bookmark);
myRatingsRow = (TableRow)view.findViewById(R.id.me_rating);
logoutRow = (TableRow)view.findViewById(R.id.me_logout);
settingsRow = (TableRow)view.findViewById(R.id.me_settings);
}

//Async thread to handle myBookmarks and myRatings request
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions frontend/Movie_Pigeon/app/src/main/res/drawable/setting_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFF"/>
<stroke
android:width="3dp"
android:color="#636363"/>
<padding
android:bottom="5dp"
android:left="5dp"
android:right="5dp"
android:top="5dp"/>
<corners
android:bottomLeftRadius="7dp"
android:bottomRightRadius="7dp"
android:topLeftRadius="7dp"
android:topRightRadius="7dp"/>
</shape>
82 changes: 63 additions & 19 deletions frontend/Movie_Pigeon/app/src/main/res/layout/fragment_me.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,68 @@
android:title=""
android:id="@+id/me_toolbar" />

<Button
android:text="My Ratings"
style="@style/me_page_button"
android:id="@+id/button_my_rating" />

<Button
android:text="My Bookmarks"
style="@style/me_page_button"
android:id="@+id/button_my_bookmarks" />

<Button
android:text="Setting"
style="@style/me_page_button"
android:id="@+id/button_setting" />

<Button
android:text="Logout"
style="@style/me_page_button"
android:id="@+id/button_logout" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableRow
android:id="@+id/me_rating"
android:padding="10dp"
android:background="@drawable/setting_menu">
<ImageView
android:src="@drawable/ic_rating_star"
android:layout_width="wrap_content"
android:layout_gravity="left"
android:scaleX="1.3"
android:scaleY="1.3"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="My ratings"
android:textSize="20sp"
android:paddingLeft="10dp"/>
</TableRow>
<TableRow
android:id="@+id/me_bookmark"
android:padding="10dp"
android:background="@drawable/setting_menu">
<ImageView
android:src="@drawable/ic_bookmark_full"
android:layout_gravity="left"
/>
<TextView
android:text="My Bookmarks"
android:textSize="20sp"
android:paddingLeft="10dp"/>
</TableRow>
<TableRow
android:id="@+id/me_settings"
android:padding="10dp"
android:background="@drawable/setting_menu">
<ImageView
android:src="@drawable/ic_settings"
android:layout_gravity="left"
android:scaleY="1.3"
android:scaleX="1.3"/>
<TextView
android:text="Settings"
android:textSize="20sp"
android:paddingLeft="10dp"/>
</TableRow>
<TableRow
android:id="@+id/me_logout"
android:layout_marginTop="300dp"
android:padding="10dp"
android:background="@drawable/setting_menu">
<ImageView
android:src="@drawable/ic_logout"
android:layout_gravity="left"
android:scaleX="1.3"
android:scaleY="1.3"/>
<TextView
android:text="Logout"
android:textSize="20sp"
android:paddingLeft="10dp"/>
</TableRow>
</TableLayout>

</LinearLayout>

0 comments on commit 4565ea5

Please sign in to comment.