mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
Sign out button is now in the hamburger menu
This commit is contained in:
parent
fdf27b9e62
commit
465318eb84
@ -202,6 +202,23 @@ public class MainActivity extends AppCompatActivity implements CreateListDialogF
|
||||
});
|
||||
}
|
||||
|
||||
public void onClickSignout(MenuItem m) {
|
||||
m.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
try {
|
||||
am.signOutUser();
|
||||
Intent intent = new Intent(MainActivity.this, com.example.listify.ui.LoginPage.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.i("Authentication", e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendNewListName(String name) {
|
||||
Properties configs = new Properties();
|
||||
|
||||
@ -29,28 +29,12 @@ import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
public class HomeFragment extends Fragment {
|
||||
private Button toLoginPage;
|
||||
private Button toDeleteAccountPage;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View root = inflater.inflate(R.layout.fragment_home, container, false);
|
||||
|
||||
toLoginPage = (Button) root.findViewById(R.id.button1);
|
||||
toLoginPage.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
try {
|
||||
am.signOutUser();
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.i("Authentication", e.toString());
|
||||
}
|
||||
Intent intent = new Intent(getActivity(), com.example.listify.ui.LoginPage.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
toDeleteAccountPage = (Button) root.findViewById(R.id.button2);
|
||||
toDeleteAccountPage = (Button) root.findViewById(R.id.button);
|
||||
toDeleteAccountPage.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@ -7,17 +7,7 @@
|
||||
tools:context=".ui.home.HomeFragment">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:text="Log out"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button2"
|
||||
android:id="@+id/button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Delete Account"
|
||||
|
||||
@ -8,22 +8,26 @@
|
||||
android:id="@+id/nav_home"
|
||||
android:icon="@drawable/ic_menu_camera"
|
||||
android:title="@string/menu_home" />
|
||||
<!-- <item-->
|
||||
<!-- android:id="@+id/nav_gallery"-->
|
||||
<!-- android:icon="@drawable/ic_menu_gallery"-->
|
||||
<!-- android:title="@string/menu_gallery" />-->
|
||||
<!-- <item-->
|
||||
<!-- android:id="@+id/nav_slideshow"-->
|
||||
<!-- android:icon="@drawable/ic_menu_slideshow"-->
|
||||
<!-- android:title="@string/menu_slideshow" />-->
|
||||
<!-- <item-->
|
||||
<!-- android:id="@+id/nav_gallery"-->
|
||||
<!-- android:icon="@drawable/ic_menu_gallery"-->
|
||||
<!-- android:title="@string/menu_gallery" />-->
|
||||
<!-- <item-->
|
||||
<!-- android:id="@+id/nav_slideshow"-->
|
||||
<!-- android:icon="@drawable/ic_menu_slideshow"-->
|
||||
<!-- android:title="@string/menu_slideshow" />-->
|
||||
<item
|
||||
android:id="@+id/nav_lists"
|
||||
android:icon="@drawable/ic_baseline_list_alt_28"
|
||||
android:title="@string/menu_lists" />
|
||||
<!-- <item-->
|
||||
<!-- android:id="@+id/nav_create_list"-->
|
||||
<!-- android:icon="@drawable/ic_baseline_add_28"-->
|
||||
<!-- android:title="Create New List"-->
|
||||
<!-- android:onClick="onClickCreateList" />-->
|
||||
<item
|
||||
android:id="@+id/nav_create_list"
|
||||
android:icon="@drawable/ic_baseline_add_28"
|
||||
android:title="Create New List"
|
||||
android:onClick="onClickCreateList"/>
|
||||
android:id="@+id/nav_logout"
|
||||
android:title="Sign out"
|
||||
android:onClick="onClickSignout" />
|
||||
</group>
|
||||
</menu>
|
||||
Loading…
Reference in New Issue
Block a user