Apostolos Fanakis
6 years ago
21 changed files with 655 additions and 53 deletions
@ -0,0 +1,136 @@ |
|||||
|
package gr.auth.databases.flavours.activities.profile; |
||||
|
|
||||
|
import android.os.Bundle; |
||||
|
import android.view.MenuItem; |
||||
|
import android.view.View; |
||||
|
|
||||
|
import com.google.android.material.floatingactionbutton.FloatingActionButton; |
||||
|
import com.google.android.material.tabs.TabLayout; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import androidx.annotation.NonNull; |
||||
|
import androidx.appcompat.app.ActionBar; |
||||
|
import androidx.appcompat.widget.Toolbar; |
||||
|
import androidx.fragment.app.Fragment; |
||||
|
import androidx.fragment.app.FragmentManager; |
||||
|
import androidx.fragment.app.FragmentPagerAdapter; |
||||
|
import androidx.viewpager.widget.ViewPager; |
||||
|
import gr.auth.databases.flavours.R; |
||||
|
import gr.auth.databases.flavours.activities.profile.fragments.ProfileDrinkRatingsFragment; |
||||
|
import gr.auth.databases.flavours.activities.profile.fragments.ProfileFoodRatingsFragment; |
||||
|
import gr.auth.databases.flavours.activities.profile.fragments.ProfileInfoFragment; |
||||
|
import gr.auth.databases.flavours.activities.profile.fragments.ProfileRestaurantRatingsFragment; |
||||
|
import gr.auth.databases.flavours.base.BaseActivity; |
||||
|
|
||||
|
public class ProfileActivity extends BaseActivity { |
||||
|
public static final String BUNDLE_USER_ID = "BUNDLE_USER_ID"; |
||||
|
private ViewPager viewPager; |
||||
|
private FloatingActionButton FAB; |
||||
|
|
||||
|
@Override |
||||
|
protected void onCreate(Bundle savedInstanceState) { |
||||
|
super.onCreate(savedInstanceState); |
||||
|
setContentView(R.layout.activity_profile); |
||||
|
|
||||
|
Toolbar toolbar = findViewById(R.id.profile_toolbar); |
||||
|
toolbar.setTitle("Username"); |
||||
|
setSupportActionBar(toolbar); |
||||
|
ActionBar actionbar = getSupportActionBar(); |
||||
|
if (actionbar != null) { |
||||
|
actionbar.setDisplayHomeAsUpEnabled(true); |
||||
|
actionbar.setHomeAsUpIndicator(R.drawable.ic_menu_black_24dp); |
||||
|
} |
||||
|
|
||||
|
createDrawer(); |
||||
|
|
||||
|
FAB = findViewById(R.id.profile_fab); |
||||
|
FAB.setOnClickListener(new View.OnClickListener() { |
||||
|
@Override |
||||
|
public void onClick(View view) { |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
viewPager = findViewById(R.id.profile_pager); |
||||
|
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { |
||||
|
public void onPageScrollStateChanged(int state) { |
||||
|
} |
||||
|
|
||||
|
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { |
||||
|
} |
||||
|
|
||||
|
public void onPageSelected(int position) { |
||||
|
if (position != 0) { |
||||
|
FAB.hide(); |
||||
|
} else { |
||||
|
FAB.show(); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
setupViewPager(viewPager); |
||||
|
TabLayout tabLayout = findViewById(R.id.profile_tabs); |
||||
|
tabLayout.setupWithViewPager(viewPager); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public boolean onOptionsItemSelected(MenuItem item) { |
||||
|
int id = item.getItemId(); |
||||
|
|
||||
|
if (id == android.R.id.home) { |
||||
|
drawer.openDrawer(); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
return super.onOptionsItemSelected(item); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onBackPressed() { |
||||
|
if (drawer.isDrawerOpen()) { |
||||
|
drawer.closeDrawer(); |
||||
|
} else { |
||||
|
super.onBackPressed(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private void setupViewPager(ViewPager viewPager) { |
||||
|
RestaurantPagerAdapter adapter = new RestaurantPagerAdapter(getSupportFragmentManager()); |
||||
|
adapter.addFrag(ProfileInfoFragment.newInstance(64), "INFO"); |
||||
|
adapter.addFrag(ProfileFoodRatingsFragment.newInstance(64), "FOODS"); |
||||
|
adapter.addFrag(ProfileDrinkRatingsFragment.newInstance(64), "DRINKS"); |
||||
|
adapter.addFrag(ProfileRestaurantRatingsFragment.newInstance(64), "PLACES"); |
||||
|
viewPager.setAdapter(adapter); |
||||
|
} |
||||
|
|
||||
|
private class RestaurantPagerAdapter extends FragmentPagerAdapter { |
||||
|
private final List<Fragment> mFragmentList = new ArrayList<>(); |
||||
|
private final List<String> mFragmentTitleList = new ArrayList<>(); |
||||
|
|
||||
|
RestaurantPagerAdapter(FragmentManager manager) { |
||||
|
super(manager); |
||||
|
} |
||||
|
|
||||
|
@NonNull |
||||
|
@Override |
||||
|
public Fragment getItem(int position) { |
||||
|
return mFragmentList.get(position); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public int getCount() { |
||||
|
return mFragmentList.size(); |
||||
|
} |
||||
|
|
||||
|
void addFrag(Fragment fragment, String title) { |
||||
|
mFragmentList.add(fragment); |
||||
|
mFragmentTitleList.add(title); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public CharSequence getPageTitle(int position) { |
||||
|
return mFragmentTitleList.get(position); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,71 @@ |
|||||
|
package gr.auth.databases.flavours.activities.profile.fragments; |
||||
|
|
||||
|
import android.content.Context; |
||||
|
import android.os.Bundle; |
||||
|
import android.view.LayoutInflater; |
||||
|
import android.view.View; |
||||
|
import android.view.ViewGroup; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
|
||||
|
import androidx.annotation.NonNull; |
||||
|
import androidx.fragment.app.Fragment; |
||||
|
import androidx.recyclerview.widget.DividerItemDecoration; |
||||
|
import androidx.recyclerview.widget.LinearLayoutManager; |
||||
|
import androidx.recyclerview.widget.RecyclerView; |
||||
|
import gr.auth.databases.flavours.R; |
||||
|
import gr.auth.databases.flavours.model.ItemRating; |
||||
|
import gr.auth.databases.flavours.utils.ItemRatingsAdapter; |
||||
|
|
||||
|
public class ProfileDrinkRatingsFragment extends Fragment { |
||||
|
|
||||
|
public ProfileDrinkRatingsFragment() { |
||||
|
// Required empty public constructor
|
||||
|
} |
||||
|
|
||||
|
private static final String PROFILE_ID = "PROFILE_ID"; |
||||
|
|
||||
|
private int profileId; |
||||
|
|
||||
|
public static ProfileDrinkRatingsFragment newInstance(int profileId) { |
||||
|
ProfileDrinkRatingsFragment fragment = new ProfileDrinkRatingsFragment(); |
||||
|
Bundle args = new Bundle(); |
||||
|
args.putInt(PROFILE_ID, profileId); |
||||
|
fragment.setArguments(args); |
||||
|
return fragment; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onCreate(Bundle savedInstanceState) { |
||||
|
super.onCreate(savedInstanceState); |
||||
|
assert getArguments() != null; |
||||
|
profileId = getArguments().getInt(PROFILE_ID); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { |
||||
|
final View rootView = inflater.inflate(R.layout.reusable_recycler_list, container, false); |
||||
|
|
||||
|
ArrayList<ItemRating> ratings = new ArrayList<>(); |
||||
|
ratings.add(new ItemRating(5, "Apostolof", "Πάρα πολύ καλό!", "2018-01-04", ItemRating.PortionSize.MEDIUM)); |
||||
|
ratings.add(new ItemRating(5, "Apostolof", "Εξαιρετικό service.\nΘα ξαναπάω!", "2018-06-08", ItemRating.PortionSize.BIG)); |
||||
|
ratings.add(new ItemRating(4, "Apostolof", "-", "2018-06-08", ItemRating.PortionSize.BIG)); |
||||
|
ratings.add(new ItemRating(4, "Apostolof", "Μου άρεσε.", "2018-06-08", ItemRating.PortionSize.MEDIUM)); |
||||
|
ratings.add(new ItemRating(5, "Apostolof", "Τέλειο.", "2018-06-08", ItemRating.PortionSize.BIG)); |
||||
|
ratings.add(new ItemRating(2, "Apostolof", "Το φαϊ άργησε πάρα πολύ!", "2018-06-08", null)); |
||||
|
ratings.add(new ItemRating(4, "Apostolof", "-", "2018-06-08", ItemRating.PortionSize.MEDIUM)); |
||||
|
|
||||
|
Context context = getContext(); |
||||
|
assert context != null; |
||||
|
ItemRatingsAdapter itemAdapter = new ItemRatingsAdapter(context, ratings); |
||||
|
RecyclerView mainContent = rootView.findViewById(R.id.recycler_list); |
||||
|
mainContent.setAdapter(itemAdapter); |
||||
|
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext()); |
||||
|
mainContent.setLayoutManager(layoutManager); |
||||
|
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mainContent.getContext(), |
||||
|
layoutManager.getOrientation()); |
||||
|
mainContent.addItemDecoration(dividerItemDecoration); |
||||
|
|
||||
|
return rootView; |
||||
|
} |
||||
|
} |
@ -0,0 +1,71 @@ |
|||||
|
package gr.auth.databases.flavours.activities.profile.fragments; |
||||
|
|
||||
|
import android.content.Context; |
||||
|
import android.os.Bundle; |
||||
|
import android.view.LayoutInflater; |
||||
|
import android.view.View; |
||||
|
import android.view.ViewGroup; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
|
||||
|
import androidx.annotation.NonNull; |
||||
|
import androidx.fragment.app.Fragment; |
||||
|
import androidx.recyclerview.widget.DividerItemDecoration; |
||||
|
import androidx.recyclerview.widget.LinearLayoutManager; |
||||
|
import androidx.recyclerview.widget.RecyclerView; |
||||
|
import gr.auth.databases.flavours.R; |
||||
|
import gr.auth.databases.flavours.model.ItemRating; |
||||
|
import gr.auth.databases.flavours.utils.ItemRatingsAdapter; |
||||
|
|
||||
|
public class ProfileFoodRatingsFragment extends Fragment { |
||||
|
|
||||
|
public ProfileFoodRatingsFragment() { |
||||
|
// Required empty public constructor
|
||||
|
} |
||||
|
|
||||
|
private static final String PROFILE_ID = "PROFILE_ID"; |
||||
|
|
||||
|
private int profileId; |
||||
|
|
||||
|
public static ProfileFoodRatingsFragment newInstance(int profileId) { |
||||
|
ProfileFoodRatingsFragment fragment = new ProfileFoodRatingsFragment(); |
||||
|
Bundle args = new Bundle(); |
||||
|
args.putInt(PROFILE_ID, profileId); |
||||
|
fragment.setArguments(args); |
||||
|
return fragment; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onCreate(Bundle savedInstanceState) { |
||||
|
super.onCreate(savedInstanceState); |
||||
|
assert getArguments() != null; |
||||
|
profileId = getArguments().getInt(PROFILE_ID); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { |
||||
|
final View rootView = inflater.inflate(R.layout.reusable_recycler_list, container, false); |
||||
|
|
||||
|
ArrayList<ItemRating> ratings = new ArrayList<>(); |
||||
|
ratings.add(new ItemRating(5, "Apostolof", "Πάρα πολύ καλό!", "2018-01-04", ItemRating.PortionSize.MEDIUM)); |
||||
|
ratings.add(new ItemRating(5, "Apostolof", "Εξαιρετικό service.\nΘα ξαναπάω!", "2018-06-08", ItemRating.PortionSize.BIG)); |
||||
|
ratings.add(new ItemRating(4, "Apostolof", "-", "2018-06-08", ItemRating.PortionSize.BIG)); |
||||
|
ratings.add(new ItemRating(4, "Apostolof", "Μου άρεσε.", "2018-06-08", ItemRating.PortionSize.MEDIUM)); |
||||
|
ratings.add(new ItemRating(5, "Apostolof", "Τέλειο.", "2018-06-08", ItemRating.PortionSize.BIG)); |
||||
|
ratings.add(new ItemRating(2, "Apostolof", "Το φαϊ άργησε πάρα πολύ!", "2018-06-08", null)); |
||||
|
ratings.add(new ItemRating(4, "Apostolof", "-", "2018-06-08", ItemRating.PortionSize.MEDIUM)); |
||||
|
|
||||
|
Context context = getContext(); |
||||
|
assert context != null; |
||||
|
ItemRatingsAdapter itemAdapter = new ItemRatingsAdapter(context, ratings); |
||||
|
RecyclerView mainContent = rootView.findViewById(R.id.recycler_list); |
||||
|
mainContent.setAdapter(itemAdapter); |
||||
|
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext()); |
||||
|
mainContent.setLayoutManager(layoutManager); |
||||
|
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mainContent.getContext(), |
||||
|
layoutManager.getOrientation()); |
||||
|
mainContent.addItemDecoration(dividerItemDecoration); |
||||
|
|
||||
|
return rootView; |
||||
|
} |
||||
|
} |
@ -0,0 +1,76 @@ |
|||||
|
package gr.auth.databases.flavours.activities.profile.fragments; |
||||
|
|
||||
|
import android.os.Bundle; |
||||
|
import android.view.LayoutInflater; |
||||
|
import android.view.View; |
||||
|
import android.view.ViewGroup; |
||||
|
import android.widget.LinearLayout; |
||||
|
import android.widget.TextView; |
||||
|
|
||||
|
import androidx.annotation.NonNull; |
||||
|
import androidx.appcompat.widget.AppCompatImageButton; |
||||
|
import androidx.fragment.app.Fragment; |
||||
|
import gr.auth.databases.flavours.R; |
||||
|
|
||||
|
public class ProfileInfoFragment extends Fragment { |
||||
|
|
||||
|
public ProfileInfoFragment() { |
||||
|
// Required empty public constructor
|
||||
|
} |
||||
|
|
||||
|
private static final String PROFILE_ID = "PROFILE_ID"; |
||||
|
|
||||
|
private int profileId; |
||||
|
|
||||
|
public static ProfileInfoFragment newInstance(int profileId) { |
||||
|
ProfileInfoFragment fragment = new ProfileInfoFragment(); |
||||
|
Bundle args = new Bundle(); |
||||
|
args.putInt(PROFILE_ID, profileId); |
||||
|
fragment.setArguments(args); |
||||
|
return fragment; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onCreate(Bundle savedInstanceState) { |
||||
|
super.onCreate(savedInstanceState); |
||||
|
assert getArguments() != null; |
||||
|
profileId = getArguments().getInt(PROFILE_ID); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { |
||||
|
final View rootView = inflater.inflate(R.layout.fragment_profile_info, container, false); |
||||
|
|
||||
|
TextView email = rootView.findViewById(R.id.profile_email); |
||||
|
email.setText(getString(R.string.profile_email_placeholder, "apotwohd@gmail.com")); |
||||
|
TextView age = rootView.findViewById(R.id.profile_age); |
||||
|
age.setText(getString(R.string.profile_age_placeholder, 23)); |
||||
|
|
||||
|
TextView numberOfRatings = rootView.findViewById(R.id.profile_number_of_reviews); |
||||
|
numberOfRatings.setText(getString(R.string.profile_number_of_reviews_placeholder, 52)); |
||||
|
numberOfRatings.setVisibility(View.VISIBLE); |
||||
|
TextView ownsRestaurant = rootView.findViewById(R.id.profile_owns_restaurant); |
||||
|
ownsRestaurant.setText(getString(R.string.profile_owns_restaurant_placeholder, "Κανένα :(")); |
||||
|
ownsRestaurant.setVisibility(View.VISIBLE); |
||||
|
|
||||
|
(rootView.findViewById(R.id.profile_diets_list_title)).setVisibility(View.VISIBLE); |
||||
|
|
||||
|
LinearLayout dietsList = rootView.findViewById(R.id.profile_diets_list); |
||||
|
dietsList.setVisibility(View.VISIBLE); |
||||
|
View userDietRow = getLayoutInflater().inflate(R.layout.profile_diet_row, dietsList, false); |
||||
|
|
||||
|
TextView dietName = userDietRow.findViewById(R.id.profile_diet_name); |
||||
|
dietName.setText("Όγκος φυσικά"); |
||||
|
AppCompatImageButton removeDiet = userDietRow.findViewById(R.id.profile_diet_remove); |
||||
|
removeDiet.setVisibility(View.VISIBLE); |
||||
|
removeDiet.setOnClickListener(new View.OnClickListener() { |
||||
|
@Override |
||||
|
public void onClick(View view) { |
||||
|
//TODO
|
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
dietsList.addView(userDietRow); |
||||
|
return rootView; |
||||
|
} |
||||
|
} |
@ -0,0 +1,71 @@ |
|||||
|
package gr.auth.databases.flavours.activities.profile.fragments; |
||||
|
|
||||
|
import android.content.Context; |
||||
|
import android.os.Bundle; |
||||
|
import android.view.LayoutInflater; |
||||
|
import android.view.View; |
||||
|
import android.view.ViewGroup; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
|
||||
|
import androidx.annotation.NonNull; |
||||
|
import androidx.fragment.app.Fragment; |
||||
|
import androidx.recyclerview.widget.DividerItemDecoration; |
||||
|
import androidx.recyclerview.widget.LinearLayoutManager; |
||||
|
import androidx.recyclerview.widget.RecyclerView; |
||||
|
import gr.auth.databases.flavours.R; |
||||
|
import gr.auth.databases.flavours.model.RestaurantRating; |
||||
|
import gr.auth.databases.flavours.utils.RestaurantRatingsAdapter; |
||||
|
|
||||
|
public class ProfileRestaurantRatingsFragment extends Fragment { |
||||
|
|
||||
|
public ProfileRestaurantRatingsFragment() { |
||||
|
// Required empty public constructor
|
||||
|
} |
||||
|
|
||||
|
private static final String PROFILE_ID = "PROFILE_ID"; |
||||
|
|
||||
|
private int profileId; |
||||
|
|
||||
|
public static ProfileRestaurantRatingsFragment newInstance(int profileId) { |
||||
|
ProfileRestaurantRatingsFragment fragment = new ProfileRestaurantRatingsFragment(); |
||||
|
Bundle args = new Bundle(); |
||||
|
args.putInt(PROFILE_ID, profileId); |
||||
|
fragment.setArguments(args); |
||||
|
return fragment; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onCreate(Bundle savedInstanceState) { |
||||
|
super.onCreate(savedInstanceState); |
||||
|
assert getArguments() != null; |
||||
|
profileId = getArguments().getInt(PROFILE_ID); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { |
||||
|
final View rootView = inflater.inflate(R.layout.reusable_recycler_list, container, false); |
||||
|
|
||||
|
ArrayList<RestaurantRating> ratings = new ArrayList<>(); |
||||
|
ratings.add(new RestaurantRating(5, "Apostolof", "Πάρα πολύ καλό!", "2018-01-04", RestaurantRating.Accessibility.MODERATE)); |
||||
|
ratings.add(new RestaurantRating(5, "Apostolof", "Εξαιρετικό service.\nΘα ξαναπάω!", "2018-06-08", RestaurantRating.Accessibility.EASY)); |
||||
|
ratings.add(new RestaurantRating(4, "Apostolof", "-", "2018-06-08", RestaurantRating.Accessibility.EASY)); |
||||
|
ratings.add(new RestaurantRating(4, "Apostolof", "Μου άρεσε.", "2018-06-08", RestaurantRating.Accessibility.MODERATE)); |
||||
|
ratings.add(new RestaurantRating(5, "Apostolof", "Τέλειο.", "2018-06-08", RestaurantRating.Accessibility.EASY)); |
||||
|
ratings.add(new RestaurantRating(2, "Apostolof", "Το φαϊ άργησε πάρα πολύ!", "2018-06-08", null)); |
||||
|
ratings.add(new RestaurantRating(4, "Apostolof", "-", "2018-06-08", RestaurantRating.Accessibility.MODERATE)); |
||||
|
|
||||
|
Context context = getContext(); |
||||
|
assert context != null; |
||||
|
RestaurantRatingsAdapter itemAdapter = new RestaurantRatingsAdapter(context, ratings); |
||||
|
RecyclerView mainContent = rootView.findViewById(R.id.recycler_list); |
||||
|
mainContent.setAdapter(itemAdapter); |
||||
|
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext()); |
||||
|
mainContent.setLayoutManager(layoutManager); |
||||
|
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(mainContent.getContext(), |
||||
|
layoutManager.getOrientation()); |
||||
|
mainContent.addItemDecoration(dividerItemDecoration); |
||||
|
|
||||
|
return rootView; |
||||
|
} |
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:background="@android:color/background_light" |
||||
|
android:fitsSystemWindows="true"> |
||||
|
|
||||
|
<com.google.android.material.appbar.AppBarLayout |
||||
|
android:id="@+id/profile_appbar" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:paddingTop="@dimen/appbar_padding_top" |
||||
|
android:theme="@style/ToolbarTheme"> |
||||
|
|
||||
|
<androidx.appcompat.widget.Toolbar |
||||
|
android:id="@+id/profile_toolbar" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="?attr/actionBarSize" |
||||
|
android:background="?attr/colorPrimary" |
||||
|
android:gravity="center" |
||||
|
app:popupTheme="@style/ToolbarTheme" /> |
||||
|
|
||||
|
<com.google.android.material.tabs.TabLayout |
||||
|
android:id="@+id/profile_tabs" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:gravity="center" |
||||
|
app:tabGravity="fill" |
||||
|
app:tabMode="fixed" |
||||
|
app:tabSelectedTextColor="@color/accent" |
||||
|
app:tabTextColor="@color/iron" /> |
||||
|
</com.google.android.material.appbar.AppBarLayout> |
||||
|
|
||||
|
<androidx.viewpager.widget.ViewPager |
||||
|
android:id="@+id/profile_pager" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
app:layout_anchor="@id/profile_appbar" |
||||
|
app:layout_anchorGravity="bottom|start" |
||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> |
||||
|
|
||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton |
||||
|
android:id="@+id/profile_fab" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="bottom|end" |
||||
|
android:layout_margin="16dp" |
||||
|
android:src="@drawable/ic_add_white_24dp" |
||||
|
app:fabSize="normal" |
||||
|
app:layout_behavior="gr.auth.databases.flavours.utils.ScrollAwareFABBehavior" /> |
||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout> |
@ -0,0 +1,54 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:orientation="vertical" |
||||
|
android:paddingStart="12dp" |
||||
|
android:paddingEnd="12dp"> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/profile_email" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:text="@string/profile_email" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/profile_age" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:text="@string/profile_age" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/profile_number_of_reviews" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:text="@string/profile_number_of_reviews" |
||||
|
android:visibility="gone" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/profile_owns_restaurant" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:text="@string/profile_owns_restaurant" |
||||
|
android:visibility="gone" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/profile_diets_list_title" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:text="@string/profile_diet_list_title" |
||||
|
android:textStyle="bold" |
||||
|
android:visibility="gone" /> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:id="@+id/profile_diets_list" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:orientation="vertical" |
||||
|
android:visibility="gone" /> |
||||
|
</LinearLayout> |
||||
|
</androidx.core.widget.NestedScrollView> |
@ -0,0 +1,25 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
android:id="@+id/profile_diet_row" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginStart="12dp" |
||||
|
android:layout_marginEnd="12dp" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/profile_diet_name" |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center_vertical" |
||||
|
android:layout_weight="1" |
||||
|
android:ellipsize="end" |
||||
|
android:text="@string/ingredient_name" /> |
||||
|
|
||||
|
<androidx.appcompat.widget.AppCompatImageButton |
||||
|
android:id="@+id/profile_diet_remove" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:src="@drawable/ic_delete_black_18dp" |
||||
|
android:visibility="gone" /> |
||||
|
</LinearLayout> |
Loading…
Reference in new issue