Skip to content

Commit

Permalink
Fix #2 - Rename About to Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
LucBerge committed Sep 20, 2023
1 parent 8c479e9 commit c7f8a09
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/example/ideator/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected void onCreate(Bundle savedInstanceState) {
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_ideas, R.id.nav_profile, R.id.nav_about)
R.id.nav_ideas, R.id.nav_profile, R.id.nav_feedback)
.setOpenableLayout(drawer)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.ideator.ui.about;
package com.example.ideator.ui.feedback;

import android.os.Bundle;
import android.view.LayoutInflater;
Expand All @@ -10,22 +10,22 @@
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;

import com.example.ideator.databinding.FragmentAboutBinding;
import com.example.ideator.databinding.FragmentFeedbackBinding;

public class AboutFragment extends Fragment {
public class FeedbackFragment extends Fragment {

private FragmentAboutBinding binding;
private FragmentFeedbackBinding binding;

public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
AboutViewModel aboutViewModel =
new ViewModelProvider(this).get(AboutViewModel.class);
FeedbackViewModel feedbackViewModel =
new ViewModelProvider(this).get(FeedbackViewModel.class);

binding = FragmentAboutBinding.inflate(inflater, container, false);
binding = FragmentFeedbackBinding.inflate(inflater, container, false);
View root = binding.getRoot();

final TextView textView = binding.textAbout;
aboutViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
final TextView textView = binding.textFeedback;
feedbackViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
return root;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.example.ideator.ui.about;
package com.example.ideator.ui.feedback;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class AboutViewModel extends ViewModel {
public class FeedbackViewModel extends ViewModel {

private final MutableLiveData<String> mText;

public AboutViewModel() {
public FeedbackViewModel() {
mText = new MutableLiveData<>();
mText.setValue("More information about us soon");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.about.AboutFragment">
tools:context=".ui.feedback.FeedbackFragment">

<TextView
android:id="@+id/text_about"
android:id="@+id/text_feedback"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/menu/activity_main_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
android:icon="@drawable/ic_menu_profile"
android:title="@string/menu_profile" />
<item
android:id="@+id/nav_about"
android:id="@+id/nav_feedback"
android:icon="@drawable/ic_menu_help"
android:title="@string/menu_about" />
android:title="@string/menu_feedback" />
</group>
</menu>
8 changes: 4 additions & 4 deletions app/src/main/res/navigation/mobile_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
tools:layout="@layout/fragment_profile" />

<fragment
android:id="@+id/nav_about"
android:name="com.example.ideator.ui.about.AboutFragment"
android:label="@string/menu_about"
tools:layout="@layout/fragment_about" />
android:id="@+id/nav_feedback"
android:name="com.example.ideator.ui.feedback.FeedbackFragment"
android:label="@string/menu_feedback"
tools:layout="@layout/fragment_feedback" />
</navigation>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<string name="menu_ideas">Ideas</string>
<string name="menu_profile">Profile</string>
<string name="menu_about">About</string>
<string name="menu_feedback">Feedback</string>

<string name="empty_ideas">You do not have ideas yet. Click the "+" button to create your first idea.</string>

Expand Down

0 comments on commit c7f8a09

Please sign in to comment.