Commit d839d2e4 authored by Paded's avatar Paded

add logout function and profile setting activity

parent 8f50c75e
...@@ -30,6 +30,8 @@ dependencies { ...@@ -30,6 +30,8 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:0.6.5' compile 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:0.6.5'
compile 'com.loopeer.lib:shadow:0.0.4-beta1'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
} }
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:windowSoftInputMode="adjustResize" /> android:windowSoftInputMode="adjustResize" />
<activity android:name=".CreateAccountActivity" <activity
android:windowSoftInputMode="adjustResize" android:name=".CreateAccountActivity"
/> android:windowSoftInputMode="adjustResize" />
<activity <activity
android:name=".SplashActivity" android:name=".SplashActivity"
android:theme="@style/SplashTheme"> android:theme="@style/SplashTheme">
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
android:name=".LoginActivity" android:name=".LoginActivity"
android:windowSoftInputMode="adjustResize" /> android:windowSoftInputMode="adjustResize" />
<activity android:name=".ResetPasswordActivity" /> <activity android:name=".ResetPasswordActivity" />
<activity android:name=".AddBusActivity"></activity> <activity android:name=".AddBusActivity" />
<activity android:name=".ProfileSettingActivity"></activity>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
package ubontransitdriver.paded.com.ubontransitdriver;
public class AllBus {
public String name;
public AllBus() {
}
public AllBus(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
package ubontransitdriver.paded.com.ubontransitdriver; package ubontransitdriver.paded.com.ubontransitdriver;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView; import com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
private FirebaseAuth auth;
private ImageButton btn_profile;
private String TAG = "mainAC";
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout); setContentView(R.layout.main_layout);
auth = FirebaseAuth.getInstance();
FirebaseUser user = auth.getCurrentUser();
btn_profile = (ImageButton)findViewById(R.id.btn_profile);
DatabaseReference database = FirebaseDatabase.getInstance().getReference();
// Attach a listener to read the data at our posts reference
database.child("users/"+user.getUid()).addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Log.d(TAG, "onDataChange: "+dataSnapshot.child("name").getValue(String.class));
Log.d(TAG, "onDataChange: "+dataSnapshot.child("bus_id").getValue(String.class));
}
@Override
public void onCancelled(DatabaseError databaseError) {
System.out.println("The read failed: " + databaseError.getCode());
}
});
btn_profile.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, ProfileSettingActivity.class);
startActivity(intent);
}
});
MaterialShadowContainerView shadowView =
(MaterialShadowContainerView) findViewById(R.id.shadow_item_container);
float density = getResources().getDisplayMetrics().density;
shadowView.setShadowTranslationZ(density * 2.0f); // 2.0 dp //
shadowView.setShadowElevation(density * 4.0f); // 4.0 dp // MaterialShadowContainerView shadowView =
// (MaterialShadowContainerView) findViewById(R.id.shadow_item_container);
//
// float density = getResources().getDisplayMetrics().density;
//
// shadowView.setShadowTranslationZ(density * 2.0f); // 2.0 dp
// shadowView.setShadowElevation(density * 4.0f); // 4.0 dp
} }
......
package ubontransitdriver.paded.com.ubontransitdriver;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ProgressBar;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class ProfileSettingActivity extends AppCompatActivity {
private ImageButton btn_back;
private Button btn_logout;
private FirebaseAuth auth;
private String TAG = "PST11";
private ProgressBar progressBar;
private FirebaseAuth.AuthStateListener authListener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.profile_setting_layout);
btn_back = (ImageButton)findViewById(R.id.btn_back);
btn_logout = (Button)findViewById(R.id.btn_logout);
progressBar = (ProgressBar)findViewById(R.id.progressBar);
//Get Firebase auth instance
auth = FirebaseAuth.getInstance();
//get current user
final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
authListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = firebaseAuth.getCurrentUser();
if (user == null) {
progressBar.setVisibility(View.GONE);
// user auth state is changed - user is null
// launch login activity
startActivity(new Intent(ProfileSettingActivity.this, LoginActivity.class));
finish();
}
}
};
btn_back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
btn_logout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
progressBar.setVisibility(View.VISIBLE);
auth.signOut();
}
});
}
@Override
public void onStart() {
super.onStart();
auth.addAuthStateListener(authListener);
}
@Override
public void onStop() {
super.onStop();
if (authListener != null) {
auth.removeAuthStateListener(authListener);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/white" />
<corners android:radius="8dp" />
<stroke
android:width="1dp"
android:color="#e7e8ea" >
</stroke>
<padding
android:bottom="7dip"
android:left="7dip"
android:right="7dip"
android:top="7dip" />
</shape>
\ No newline at end of file
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" > <shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/white" /> <solid android:color="@color/white" />
<corners android:radius="8dp" /> <corners android:radius="8dp" />
<stroke
android:width="1dp"
android:color="#e7e8ea" >
</stroke>
<padding <padding
android:bottom="7dip" android:bottom="7dip"
android:left="7dip" android:left="7dip"
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/bg_endtrip_bus_clicked" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/bg_endtrip_bus_clicked" />
<item android:drawable="@drawable/bg_endtrip_bus_normal" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/gray_100" />
<corners android:radius="8dp" />
<padding
android:bottom="7dip"
android:left="7dip"
android:right="7dip"
android:top="7dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/white" />
<corners android:radius="8dp" />
<stroke
android:width="1dp"
android:color="#e7e8ea" >
</stroke>
<padding
android:bottom="7dip"
android:left="7dip"
android:right="7dip"
android:top="7dip" />
</shape>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/gray" >
</solid>
<padding
android:left="10dp"
android:top="5dp"
android:right="10dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="12dp" >
</corners>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/bg_logout_clicked" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/bg_logout_clicked" />
<item android:drawable="@drawable/bg_logout_normal" />
</selector>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/gray_100" >
</solid>
<!--<stroke-->
<!--android:width="2dp"-->
<!--android:color="#C4CDE0" >-->
<!--</stroke>-->
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="12dp" >
</corners>
</shape>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/white" >
</solid>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="12dp" >
</corners>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/green" />
<corners android:radius="1dp"
android:bottomRightRadius="0dp" android:bottomLeftRadius="0dp"
android:topLeftRadius="8dp" android:topRightRadius="8dp"/>
<padding
android:bottom="7dip"
android:left="7dip"
android:right="7dip"
android:top="7dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/bg_profile_clicked" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/bg_profile_clicked" />
<item android:drawable="@drawable/bg_profile_normal" />
</selector>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/gray" >
</solid>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="360dp" >
</corners>
</shape>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/white" >
</solid>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="360dp" >
</corners>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/bg_return_bus_clicked" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/bg_return_bus_clicked" />
<item android:drawable="@drawable/bg_return_bus_normal" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/off_blue" />
<corners android:radius="8dp" />
<padding
android:bottom="7dip"
android:left="7dip"
android:right="7dip"
android:top="7dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/blue" />
<corners android:radius="8dp" />
<padding
android:bottom="7dip"
android:left="7dip"
android:right="7dip"
android:top="7dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/btn_heading_clicked" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/btn_heading_clicked" />
<item android:drawable="@drawable/btn_heading_normal" />
</selector>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/gray_100" >
</solid>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="8dp" >
</corners>
</shape>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/white" >
</solid>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="12dp" >
</corners>
</shape>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/green" >
</solid>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="8dp" >
</corners>
</shape>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/red" >
</solid>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="8dp" >
</corners>
</shape>
\ No newline at end of file
<vector android:height="24dp" android:viewportHeight="51.976"
android:viewportWidth="51.976" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/gray_500" android:pathData="M44.373,7.603c-10.137,-10.137 -26.632,-10.138 -36.77,0c-10.138,10.138 -10.137,26.632 0,36.77s26.632,10.138 36.77,0C54.51,34.235 54.51,17.74 44.373,7.603zM36.241,36.241c-0.781,0.781 -2.047,0.781 -2.828,0l-7.425,-7.425l-7.778,7.778c-0.781,0.781 -2.047,0.781 -2.828,0c-0.781,-0.781 -0.781,-2.047 0,-2.828l7.778,-7.778l-7.425,-7.425c-0.781,-0.781 -0.781,-2.048 0,-2.828c0.781,-0.781 2.047,-0.781 2.828,0l7.425,7.425l7.071,-7.071c0.781,-0.781 2.047,-0.781 2.828,0c0.781,0.781 0.781,2.047 0,2.828l-7.071,7.071l7.425,7.425C37.022,34.194 37.022,35.46 36.241,36.241z"/>
</vector>
<vector android:height="24dp" android:viewportHeight="513.0"
android:viewportWidth="513.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/white" android:pathData="M453.5,78c-3.333,-14 -9,-24.667 -17,-32s-19.667,-14 -35,-20c-15.333,-6.667 -37.333,-12.667 -66,-18S280.666,0 257,0c-23.667,0 -49.833,2.667 -78.5,8s-50.667,11.333 -66,18c-15.333,6 -27,12.667 -35,20s-13.333,18 -16,32l-20,160v223h31v20c0,13.333 4.167,22.667 12.5,28s16.833,5.333 25.5,0s13,-14.667 13,-28v-20h256v20c0,13.333 5.167,22.667 15.5,28s20.5,5.333 30.5,0s15,-14.667 15,-28v-20h31V238L453.5,78zM150.5,38.5c2.667,-5 7.334,-7.5 14,-7.5h205v30h-205c-6.667,0 -11.333,-2.5 -14,-7.5S147.833,43.5 150.5,38.5zM77.5,234l17,-122c1.333,-6.667 7,-10 17,-10h293c10,0 15.667,3.333 17,10l17,124c0.667,2 1,3.333 1,4c0,4.667 -1.667,8.5 -5,11.5s-7.667,4.5 -13,4.5h-327c-5.333,0 -9.667,-1.667 -13,-5s-5,-7.667 -5,-13C76.5,236.667 76.833,235.333 77.5,234zM130.5,383.5c-6.667,6.333 -14.5,9.5 -23.5,9.5s-16.833,-3.167 -23.5,-9.5s-10,-14 -10,-23s3.333,-16.667 10,-23c6.667,-6.333 14.5,-9.5 23.5,-9.5s16.833,3.167 23.5,9.5s10,14 10,23S137.167,377.167 130.5,383.5zM432.5,383.5c-6.667,6.333 -14.5,9.5 -23.5,9.5s-16.833,-3.167 -23.5,-9.5s-10,-14 -10,-23s3.333,-16.667 10,-23S400,328 409,328s16.833,3.167 23.5,9.5s10,14 10,23S439.167,377.167 432.5,383.5z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
<path
android:fillColor="#FF000000"
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z" />
</vector>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/gray_600"
android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/gray_900"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/gray_500"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>
<vector android:height="24dp" android:viewportHeight="55.753"
android:viewportWidth="55.753" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/gray_500" android:pathData="M12.745,23.915c0.283,-0.282 0.59,-0.52 0.913,-0.727L35.266,1.581c2.108,-2.107 5.528,-2.108 7.637,0.001c2.109,2.108 2.109,5.527 0,7.637L24.294,27.828l18.705,18.706c2.109,2.108 2.109,5.526 0,7.637c-1.055,1.056 -2.438,1.582 -3.818,1.582s-2.764,-0.526 -3.818,-1.582L13.658,32.464c-0.323,-0.207 -0.632,-0.445 -0.913,-0.727c-1.078,-1.078 -1.598,-2.498 -1.572,-3.911C11.147,26.413 11.667,24.994 12.745,23.915z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/gray_900"
android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/gray_900"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/>
</vector>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/white" >
</solid>
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<!--<corners-->
<!--android:radius="8dp" >-->
<!--</corners>-->
</shape>
<!--<shape xmlns:android="http://schemas.android.com/apk/res/android"-->
<!--android:shape="rectangle">-->
<!--<gradient-->
<!--android:angle="135"-->
<!--android:centerColor="#009688"-->
<!--android:endColor="#00695C"-->
<!--android:startColor="#4DB6AC"-->
<!--android:type="linear" />-->
<!--</shape>-->
\ No newline at end of file
...@@ -14,12 +14,13 @@ ...@@ -14,12 +14,13 @@
android:layout_height="60dp" android:layout_height="60dp"
android:layout_gravity="center" android:layout_gravity="center"
android:drawablePadding="@dimen/activity_horizontal_margin" android:drawablePadding="@dimen/activity_horizontal_margin"
android:textColor="@color/half_black" android:textSize="18dp"
android:textStyle="bold"
android:textColor="@color/gray_900"
android:background="@drawable/bg_add_bus_menu" android:background="@drawable/bg_add_bus_menu"
android:drawableStart="@drawable/ic_frontal_bus_silhouette" android:drawableStart="@drawable/ic_frontal_bus_silhouette"
android:gravity="center_vertical" android:gravity="center_vertical"
android:padding="@dimen/activity_horizontal_margin" android:padding="@dimen/activity_horizontal_margin" />
android:text="@string/Bus_no0" />
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:background="@color/white"
tools:context=".CreateAccountActivity"> tools:context=".CreateAccountActivity">
<FrameLayout <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
...@@ -76,7 +77,23 @@ ...@@ -76,7 +77,23 @@
android:inputType="textPassword" android:inputType="textPassword"
android:padding="15dp" /> android:padding="15dp" />
<Button <!--<View-->
<!--android:layout_marginTop="18dp"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="0.5dp"-->
<!--android:background="@color/gray"/>-->
<!--<TextView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:textColor="@color/blue"-->
<!--android:textSize="16dp"-->
<!--android:layout_marginTop="12dp"-->
<!--android:text="Add your bus"/>-->
<EditText
android:focusable="false"
android:id="@+id/btn_addBus" android:id="@+id/btn_addBus"
style="?android:attr/borderlessButtonStyle" style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -88,6 +105,7 @@ ...@@ -88,6 +105,7 @@
android:drawablePadding="10dp" android:drawablePadding="10dp"
android:gravity="left|center_vertical" android:gravity="left|center_vertical"
android:padding="15dp" android:padding="15dp"
android:textStyle="bold"
android:text="@string/add_bus_label" android:text="@string/add_bus_label"
android:textColor="@color/blue" /> android:textColor="@color/blue" />
...@@ -158,16 +176,17 @@ ...@@ -158,16 +176,17 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Choose your bus" android:text="Choose your bus"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:textSize="16dp" android:textSize="17dp"
android:textColor="@color/gray_500" android:paddingTop="16dp"
android:textColor="@color/half_black"
android:textStyle="bold" /> android:textStyle="bold" />
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView" android:id="@+id/recyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" android:layout_marginBottom="0dp"
android:layout_marginTop="16dp" /> android:layout_marginTop="18dp" />
</LinearLayout> </LinearLayout>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/mainlayout" android:id="@+id/mainlayout"
android:background="@color/white"
tools:context=".LoginActivity"> tools:context=".LoginActivity">
<LinearLayout <LinearLayout
......
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context=".ProfileSettingActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="12dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
>
<ImageButton
android:id="@+id/btn_back"
style="?android:attr/borderlessButtonStyle"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/bg_profile"
android:src="@drawable/ic_previous" />
<TextView
android:layout_marginLeft="8dp"
android:textSize="18dp"
android:text="Settings"
android:textColor="@color/gray_600"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
>
<Button
android:id="@+id/btn_logout"
android:textSize="25dp"
android:paddingLeft="12dp"
style="?android:attr/borderlessButtonStyle"
android:text="Log out"
android:gravity="left|center_vertical"
android:textAllCaps="false"
android:background="@drawable/bg_logout"
android:textColor="@color/gray_500"
android:textStyle="bold"
android:layout_gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:padding="10dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="158dp"
android:layout_height="30dp"
android:layout_gravity="center|bottom"
android:layout_marginBottom="20dp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fillViewport="true" android:fillViewport="true"
android:background="@color/white"
tools:context=".ResetPasswordActivity"> tools:context=".ResetPasswordActivity">
<RelativeLayout <RelativeLayout
......
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never" />
</menu>
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_camera"
android:icon="@drawable/ic_menu_camera"
android:title="Import" />
<item
android:id="@+id/nav_gallery"
android:icon="@drawable/ic_menu_gallery"
android:title="Gallery" />
<item
android:id="@+id/nav_slideshow"
android:icon="@drawable/ic_menu_slideshow"
android:title="Slideshow" />
<item
android:id="@+id/nav_manage"
android:icon="@drawable/ic_menu_manage"
android:title="Tools" />
</group>
<item android:title="Communicate">
<menu>
<item
android:id="@+id/nav_share"
android:icon="@drawable/ic_menu_share"
android:title="Share" />
<item
android:id="@+id/nav_send"
android:icon="@drawable/ic_menu_send"
android:title="Send" />
</menu>
</item>
</menu>
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
<color name="white">#ffffff</color> <color name="white">#ffffff</color>
<color name="off_white">#fafAFA</color> <color name="off_white">#fafAFA</color>
<color name="off_white_100">#F5F5F5</color>
<color name="off_white_200">#EEEEEE</color>
<color name="blue">#007aff</color> <color name="blue">#007aff</color>
<color name="off_blue">#006ee7</color> <color name="off_blue">#006ee7</color>
...@@ -19,6 +22,10 @@ ...@@ -19,6 +22,10 @@
<color name="gray_100">#F5F5F5</color> <color name="gray_100">#F5F5F5</color>
<color name="gray_500">#9E9E9E</color> <color name="gray_500">#9E9E9E</color>
<color name="gray_400">#BDBDBD</color> <color name="gray_400">#BDBDBD</color>
<color name="gray_600"> #757575</color>
<color name="gray_900">#212121</color>
......
...@@ -2,5 +2,8 @@ ...@@ -2,5 +2,8 @@
<!-- Default screen margins, per the Android Design guidelines. --> <!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources> </resources>
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<!--Label--> <!--Label-->
<string name="create_account_label">Create your account</string> <string name="create_account_label">Create your account</string>
<string name="add_bus_label">Pick your bus</string> <string name="add_bus_label">Add Your Bus</string>
<string name="login_label">Login</string> <string name="login_label">Login</string>
<string name="forgot_password_label">Forgot password?</string> <string name="forgot_password_label">Forgot password?</string>
<string name="forgot_password_msg">We just need your registered Email Id to sent you password reset instructions.</string> <string name="forgot_password_msg">We just need your registered Email Id to sent you password reset instructions.</string>
...@@ -24,19 +24,13 @@ ...@@ -24,19 +24,13 @@
<string name="send_password_reset_email">Send Password reset email</string> <string name="send_password_reset_email">Send Password reset email</string>
<string name="send_password_reset_success_msg">We have sent you instructions to reset your password!</string> <string name="send_password_reset_success_msg">We have sent you instructions to reset your password!</string>
<string name="send_password_reset_failed_msg">Failed to send reset email!</string> <string name="send_password_reset_failed_msg">Failed to send reset email!</string>
<string name="title_activity_main2">Main2Activity</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<!--Bus stop--> <string name="navigation_drawer_close">Close navigation drawer</string>
<string name="Bus_no0">ม.</string> <string name="nav_header_title">Android Studio</string>
<string name="Bus_no1">1</string> <string name="nav_header_subtitle">android.studio@android.com</string>
<string name="Bus_no2">สาย 2</string> <string name="nav_header_desc">Navigation header</string>
<string name="Bus_no3">สาย 3</string> <string name="action_settings">Settings</string>
<string name="Bus_no4">สาย 7</string>
<string name="Bus_no5">สาย 8</string>
<string name="Bus_no6">สาย 9</string>
<string name="Bus_no7">สาย 10</string>
<string name="Bus_no8">สาย 11</string>
<string name="Bus_no9">สาย 12</string>
</resources> </resources>
...@@ -3,21 +3,43 @@ ...@@ -3,21 +3,43 @@
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorPrimary">@color/off_white</item> <item name="colorPrimary">@color/white</item>
<item name="colorPrimaryDark">@color/off_white</item> <item name="colorPrimaryDark">@color/white</item>
<item name="android:windowLightStatusBar">true</item> <item name="android:windowLightStatusBar">true</item>
<!--<item name="android:windowTranslucentStatus">true</item>-->
<!--<item name="android:windowTranslucentNavigation">true</item>-->
</style>
<style name="AppTheme2" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/white</item>
<item name="colorPrimaryDark">@color/white</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style> </style>
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppThemeActionbar" parent="Theme.AppCompat.Light.DarkActionBar"> <style name="AppThemeActionbar" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorPrimary">@color/off_white</item> <item name="colorPrimary">@color/white</item>
<item name="colorPrimaryDark">@color/off_white</item> <item name="colorPrimaryDark">@color/white</item>
<item name="android:windowLightStatusBar">true</item> <item name="android:windowLightStatusBar">true</item>
</style> </style>
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar"> <style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/bg_splash</item> <item name="android:windowBackground">@drawable/bg_splash</item>
</style> </style>
<style name="MyAppTheme" parent="android:Theme.Holo.Light">
<item name="elevation">0dp</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">
<item name="colorPrimaryDark">@color/red</item>
</style>
</resources> </resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment