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
|
@Override
|
||||||
public void sendNewListName(String name) {
|
public void sendNewListName(String name) {
|
||||||
Properties configs = new Properties();
|
Properties configs = new Properties();
|
||||||
|
|||||||
@ -29,28 +29,12 @@ import java.io.IOException;
|
|||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
public class HomeFragment extends Fragment {
|
public class HomeFragment extends Fragment {
|
||||||
private Button toLoginPage;
|
|
||||||
private Button toDeleteAccountPage;
|
private Button toDeleteAccountPage;
|
||||||
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View root = inflater.inflate(R.layout.fragment_home, container, false);
|
View root = inflater.inflate(R.layout.fragment_home, container, false);
|
||||||
|
|
||||||
toLoginPage = (Button) root.findViewById(R.id.button1);
|
toDeleteAccountPage = (Button) root.findViewById(R.id.button);
|
||||||
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.setOnClickListener(new View.OnClickListener() {
|
toDeleteAccountPage.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|||||||
@ -7,17 +7,7 @@
|
|||||||
tools:context=".ui.home.HomeFragment">
|
tools:context=".ui.home.HomeFragment">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/button1"
|
android:id="@+id/button"
|
||||||
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:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Delete Account"
|
android:text="Delete Account"
|
||||||
|
|||||||
@ -8,22 +8,26 @@
|
|||||||
android:id="@+id/nav_home"
|
android:id="@+id/nav_home"
|
||||||
android:icon="@drawable/ic_menu_camera"
|
android:icon="@drawable/ic_menu_camera"
|
||||||
android:title="@string/menu_home" />
|
android:title="@string/menu_home" />
|
||||||
<!-- <item-->
|
<!-- <item-->
|
||||||
<!-- android:id="@+id/nav_gallery"-->
|
<!-- android:id="@+id/nav_gallery"-->
|
||||||
<!-- android:icon="@drawable/ic_menu_gallery"-->
|
<!-- android:icon="@drawable/ic_menu_gallery"-->
|
||||||
<!-- android:title="@string/menu_gallery" />-->
|
<!-- android:title="@string/menu_gallery" />-->
|
||||||
<!-- <item-->
|
<!-- <item-->
|
||||||
<!-- android:id="@+id/nav_slideshow"-->
|
<!-- android:id="@+id/nav_slideshow"-->
|
||||||
<!-- android:icon="@drawable/ic_menu_slideshow"-->
|
<!-- android:icon="@drawable/ic_menu_slideshow"-->
|
||||||
<!-- android:title="@string/menu_slideshow" />-->
|
<!-- android:title="@string/menu_slideshow" />-->
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_lists"
|
android:id="@+id/nav_lists"
|
||||||
android:icon="@drawable/ic_baseline_list_alt_28"
|
android:icon="@drawable/ic_baseline_list_alt_28"
|
||||||
android:title="@string/menu_lists" />
|
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
|
<item
|
||||||
android:id="@+id/nav_create_list"
|
android:id="@+id/nav_logout"
|
||||||
android:icon="@drawable/ic_baseline_add_28"
|
android:title="Sign out"
|
||||||
android:title="Create New List"
|
android:onClick="onClickSignout" />
|
||||||
android:onClick="onClickCreateList"/>
|
|
||||||
</group>
|
</group>
|
||||||
</menu>
|
</menu>
|
||||||
Loading…
Reference in New Issue
Block a user