Commit ff71e0b5 authored by Nadun K Bandara's avatar Nadun K Bandara

Implemented

- login view/ sign up view
- navigation to main and home screen
parent 42db0c97
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.jachdev.consumerprotection">
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the "MyLocation" functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:name=".AppApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ConsumerProtection"
android:usesCleartextTraffic="true">
<activity android:name=".ui.calories.ExercisesSuggeserActivity"></activity>
<activity android:name=".ui.calories.CaloriesActivity" />
<activity android:name=".ui.classifier.ClassifierActivity" />
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<activity
android:name=".ui.map.MapsActivity"
android:label="@string/title_activity_maps" />
<activity android:name=".ui.vendor.VendorActivity" />
<activity
android:name=".ui.MainActivity"
android:screenOrientation="portrait"
android:theme="@style/Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.LoginActivity"
android:screenOrientation="portrait"
android:theme="@style/ThemeAuthentication">
<intent-filter
android:autoVerify="true"
tools:targetApi="23">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="consumerprotection.page.link"
android:scheme="http" />
<data
android:host="consumerprotection.page.link"
android:scheme="https" />
</intent-filter>
</activity>
<activity
android:name=".ui.SignUpActivity"
android:screenOrientation="portrait"
android:theme="@style/ThemeAuthentication" />
<activity
android:name=".ui.HomeActivity"
android:label="@string/title_activity_home" />
<activity
android:name=".ui.map.SearchLocationActivity"
android:label="@string/title_activity_search_location" />
</application>
</manifest>
\ No newline at end of file
package com.jachdev.consumerprotection.ui;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.jachdev.commonlibs.base.BaseActivity;
import com.jachdev.consumerprotection.R;
import com.jachdev.consumerprotection.ui.calories.CaloriesActivity;
import com.jachdev.consumerprotection.ui.classifier.ClassifierActivity;
import com.jachdev.consumerprotection.ui.dashboard.DashboardFragment;
import com.jachdev.consumerprotection.ui.home.HomeFragment;
import com.jachdev.consumerprotection.ui.map.MapsActivity;
import com.jachdev.consumerprotection.ui.prediction.ComplaintsFragment;
import com.jachdev.consumerprotection.ui.prediction.ContactUsFragment;
import com.jachdev.consumerprotection.util.SessionManager;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.navigation.NavController;
import androidx.navigation.NavDestination;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import butterknife.BindView;
public class HomeActivity extends BaseActivity implements HomeFragment.FragmentEventListener, DashboardFragment.FragmentEventListener{
private static final String TAG = HomeActivity.class.getSimpleName();
@BindView(R.id.nav_view)
BottomNavigationView navigationView;
private NavController navController;
@Override
protected int layoutRes() {
return R.layout.activity_home;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
navigationView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications)
.build();
navController = Navigation.findNavController(this, R.id.nav_host_fragment);
navController.addOnDestinationChangedListener(mOnDestinationChangedListener);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
}
@Override
protected void onResume() {
super.onResume();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
SessionManager.getInstance().logoutSession();
activityToActivity(LoginActivity.class);
HomeActivity.this.finish();
return super.onOptionsItemSelected(item);
}
private NavController.OnDestinationChangedListener mOnDestinationChangedListener = new NavController.OnDestinationChangedListener() {
@Override
public void onDestinationChanged(@NonNull @NotNull NavController controller, @NonNull @NotNull NavDestination destination, @Nullable @org.jetbrains.annotations.Nullable Bundle arguments) {
switch (controller.getCurrentDestination().getId()){
case R.id.navigation_home:
navigationView.setVisibility(View.VISIBLE);
break;
}
}
};
@Override
public void onNearestStocksClick() {
Intent intent = new Intent(HomeActivity.this, MapsActivity.class);
intent.setAction(PredictionFragment.ACTION);
activityToActivity(intent, 0);
}
@Override
public void onNearestShopsClick() {
Intent intent = new Intent(HomeActivity.this, MapsActivity.class);
intent.setAction(PredictionFragment.ACTION);
activityToActivity(intent, 0);
}
@Override
public void onImportClick() {
Intent intent = new Intent(HomeActivity.this, PredictionActivity.class);
intent.putExtra(PredictionActivity.KEY_PREDICTION_TYPE, PredictionType.IMPORT.getId());
intent.setAction(PredictionFragment.ACTION);
activityToActivity(intent, 0);
}
@Override
public void onPriceClick() {
Intent intent = new Intent(HomeActivity.this, PredictionActivity.class);
intent.putExtra(PredictionActivity.KEY_PREDICTION_TYPE, PredictionType.PRICE.getId());
intent.setAction(PredictionFragment.ACTION);
activityToActivity(intent, 0);
}
@Override
public void onSaleClick() {
Intent intent = new Intent(HomeActivity.this, PredictionActivity.class);
intent.putExtra(PredictionActivity.KEY_PREDICTION_TYPE, PredictionType.SALES.getId());
intent.setAction(PredictionFragment.ACTION);
activityToActivity(intent, 0);
}
@Override
public void onComplaintsClick() {
Intent intent = new Intent(HomeActivity.this, PredictionActivity.class);
intent.setAction(ComplaintsFragment.ACTION);
activityToActivity(intent, 0);
}
@Override
public void onContactUsClick() {
Intent intent = new Intent(HomeActivity.this, PredictionActivity.class);
intent.setAction(ContactUsFragment.ACTION);
activityToActivity(intent, 0);
}
@Override
public void onImageRecognitionClick() {
Intent intent = new Intent(HomeActivity.this, ClassifierActivity.class);
intent.setAction(ContactUsFragment.ACTION);
activityToActivity(intent, 0);
}
@Override
public void onCalorieCounterClick() {
Intent intent = new Intent(HomeActivity.this, CaloriesActivity.class);
intent.setAction(ContactUsFragment.ACTION);
activityToActivity(intent, 0);
}
@Override
public void onMealPlanClick() {
}
}
\ No newline at end of file
package com.jachdev.consumerprotection.ui;
import android.os.Bundle;
import com.jachdev.commonlibs.base.BaseActivity;
import com.jachdev.consumerprotection.R;
import com.jachdev.consumerprotection.util.SessionManager;
import androidx.annotation.Nullable;
public class MainActivity extends BaseActivity {
@Override
protected int layoutRes() {
return R.layout.activity_main;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean isLoggedIn = SessionManager.getInstance().isLoggedIn();
activityToActivity(isLoggedIn ? HomeActivity.class : LoginActivity.class);
MainActivity.this.finish();
}
}
\ No newline at end of file
package com.jachdev.consumerprotection.ui;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import butterknife.BindView;
import io.reactivex.FlowableSubscriber;
import io.reactivex.Scheduler;
import io.reactivex.SingleObserver;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.google.gson.Gson;
import com.jachdev.commonlibs.base.BaseActivity;
import com.jachdev.commonlibs.validator.Validator;
import com.jachdev.commonlibs.widget.CustomEditText;
import com.jachdev.commonlibs.widget.CustomTextView;
import com.jachdev.consumerprotection.AppApplication;
import com.jachdev.consumerprotection.R;
import com.jachdev.consumerprotection.data.AppResponse;
import com.jachdev.consumerprotection.data.User;
import com.jachdev.consumerprotection.data.enums.UserType;
import com.jachdev.consumerprotection.network.AppService;
import com.jachdev.consumerprotection.util.SessionManager;
import com.pd.chocobar.ChocoBar;
import org.jetbrains.annotations.NotNull;
import org.reactivestreams.Subscription;
public class SignUpActivity extends BaseActivity {
private static final String TAG = SignUpActivity.class.getSimpleName();
@BindView(R.id.rg_user_type)
RadioGroup radioGroup;
@BindView(R.id.et_name)
CustomEditText etName;
@BindView(R.id.et_email)
CustomEditText etEmail;
@BindView(R.id.et_phone)
CustomEditText etPhone;
@BindView(R.id.et_password)
CustomEditText etPassword;
@BindView(R.id.et_confirm_password)
CustomEditText etConfirmPassword;
@BindView(R.id.tv_user_type)
CustomTextView tvUserType;
private AppService service;
@Override
protected int layoutRes() {
return R.layout.activity_sign_up;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
service = AppApplication.getInstance().getAppService();
radioGroup.setOnCheckedChangeListener(mOnCheckedChangeListener);
((RadioButton)radioGroup.getChildAt(0)).setChecked(true);
}
public void onSignUnClick(View view) {
if(!Validator.isValidField(etName) || !Validator.isValidEmail(etEmail) || !Validator.isValidPhoneNumber(etPhone) || !Validator.isValidChangedPassword(etPassword, etConfirmPassword)){
return;
}
callSignUp();
}
private void callSignUp() {
User user = new User();
user.setType((Integer) tvUserType.getTag());
user.setEmail(etEmail.getTrimText());
user.setNumber(etPhone.getTrimText());
user.setPassword(etPassword.getTrimText());
user.setBirthDay(0);
user.setName(etName.getTrimText());
user.setGender(0);
service.getServer().signUp(user)
.subscribeOn(Schedulers.io())
.subscribe(new SingleObserver<AppResponse>() {
@Override
public void onSubscribe(@NotNull Disposable d) {
Log.d(TAG, "onSubscribe: ");
}
@Override
public void onSuccess(@NotNull AppResponse response) {
switch (response.getCode()){
case 0:
onBackPressed();
break;
default:
showError(response.getMessage());
break;
}
}
@Override
public void onError(@NotNull Throwable e) {
Log.d(TAG, "onError: " + e.getMessage());
}
});
}
private final RadioGroup.OnCheckedChangeListener mOnCheckedChangeListener = new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup rg, int i) {
String userType = null;
switch (rg.getCheckedRadioButtonId()){
case R.id.rb_admin:
tvUserType.setAnyText(UserType.ADMIN.getName());
tvUserType.setTag(UserType.ADMIN.getId());
break;
case R.id.rb_consumer:
tvUserType.setAnyText(UserType.CONSUMER.getName());
tvUserType.setTag(UserType.CONSUMER.getId());
break;
case R.id.rb_vendor:
tvUserType.setAnyText(UserType.VENDOR.getName());
tvUserType.setTag(UserType.VENDOR.getId());
break;
}
}
};
private void showError(String message){
ChocoBar.builder().setBackgroundColor(Color.parseColor("#FFA61B1B"))
.setTextSize(18)
.setTextColor(Color.parseColor("#FFFFFF"))
.setTextTypefaceStyle(Typeface.ITALIC)
.setText(message)
.setMaxLines(4)
.centerText()
.setActionText(getString(R.string.ok))
.setActivity(this)
.build()
.show();
}
}
\ No newline at end of file
package com.jachdev.consumerprotection.ui.home;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import com.jachdev.commonlibs.base.BaseFragment;
import com.jachdev.commonlibs.widget.CustomTextView;
import com.jachdev.consumerprotection.R;
import com.jachdev.consumerprotection.data.User;
import com.jachdev.consumerprotection.data.enums.UserType;
import com.jachdev.consumerprotection.util.SessionManager;
import org.jetbrains.annotations.NotNull;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import butterknife.BindView;
import butterknife.OnClick;
public class HomeFragment extends BaseFragment {
@BindView(R.id.tv_header)
CustomTextView tvHeader;
private HomeViewModel homeViewModel;
private FragmentEventListener listener;
@Override
protected int layoutRes() {
return R.layout.fragment_home;
}
@Override
public void onViewCreated(@NonNull @NotNull View view, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
homeViewModel =
new ViewModelProvider(this).get(HomeViewModel.class);
init();
homeViewModel.getUser().observe(getViewLifecycleOwner(), mUserObserver);
}
private void init() {
UserType userType = SessionManager.getInstance().getUser().getUserType();
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
listener = (FragmentEventListener) context;
}
private Observer<? super User> mUserObserver = new Observer<User>() {
@Override
public void onChanged(@Nullable User user) {
String header = getString(R.string.hello) + " " + user.getName();
tvHeader.setAnyText(header);
}
};
@OnClick(R.id.btn_image_rec)
public void onImageRecognitionClick(){
if(listener != null)
listener.onImageRecognitionClick();
}
@OnClick(R.id.btn_calorie_count)
public void onCalorieCounterClick(){
if(listener != null)
listener.onCalorieCounterClick();
}
@OnClick(R.id.btn_meal_plan)
public void onMealPlanClick(){
if(listener != null)
listener.onMealPlanClick();
}
public interface FragmentEventListener{
void onImageRecognitionClick();
void onCalorieCounterClick();
void onMealPlanClick();
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />
<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="@id/nav_view"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/vendor_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:fitsSystemWindows="false"
tools:context=".ui.LoginActivity">
<com.jachdev.consumerprotection.ui.widget.HeaderView
android:id="@+id/headerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:text="@string/login" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/headerView">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/medium">
<LinearLayout
android:id="@+id/layout_pin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
android:padding="@dimen/medium">
<com.jachdev.commonlibs.widget.CustomEditText
android:id="@+id/et_pin"
style="@style/EditText"
android:layout_marginTop="@dimen/medium"
android:hint="@string/enter_6_digit_pin"
android:inputType="number"
app:fontType="@string/font_para"
app:layout_constraintTop_toBottomOf="@+id/headerView" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/stroke"
android:background="@color/colorPrimary"
android:layout_margin="@dimen/medium"/>
<com.jachdev.commonlibs.widget.CustomButton
app:fontType="@string/font_para"
android:text="@string/submit"
style="@style/Button"
android:onClick="onSubmitClick"/>
<com.jachdev.commonlibs.widget.CustomButton
app:fontType="@string/font_para"
android:layout_marginTop="@dimen/low"
android:text="@string/cancel"
style="@style/Button"
android:onClick="onCancelClick"/>
</LinearLayout>
<LinearLayout
android:id="@+id/layout_sign_in"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/medium">
<com.jachdev.commonlibs.widget.CustomEditText
android:id="@+id/et_phone"
style="@style/EditText"
android:layout_marginTop="@dimen/medium"
android:hint="@string/_947"
android:inputType="phone"
app:fontType="@string/font_para"
app:layout_constraintTop_toBottomOf="@+id/headerView" />
<com.jachdev.commonlibs.widget.CustomEditText
android:id="@+id/et_email"
android:layout_marginTop="@dimen/medium"
style="@style/EditText"
android:hint="@string/email"
android:inputType="textEmailAddress"
app:fontType="@string/font_para"
app:layout_constraintTop_toBottomOf="@+id/headerView" />
<com.jachdev.commonlibs.widget.CustomEditText
android:id="@+id/et_password"
style="@style/EditText"
android:layout_marginTop="@dimen/medium"
android:hint="@string/password"
android:inputType="textPassword"
app:fontType="@string/font_para"
app:layout_constraintTop_toBottomOf="@+id/headerView" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/stroke"
android:background="@color/colorPrimary"
android:layout_margin="@dimen/medium"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal">
<com.jachdev.commonlibs.widget.CustomTextView
app:fontType="@string/font_para"
android:text="@string/don_t_you_have_an_account"
style="@style/TextView" />
<com.jachdev.commonlibs.widget.CustomTextView
app:fontType="@string/font_header"
android:text="@string/sign_up"
android:textColor="@color/colorPrimaryText"
style="@style/TextView"
android:paddingStart="@dimen/low"
android:paddingEnd="@dimen/low"
android:onClick="onSignUpClick"/>
</LinearLayout>
<com.jachdev.commonlibs.widget.CustomButton
android:layout_marginTop="@dimen/medium"
app:fontType="@string/font_para"
android:text="@string/sign_in"
style="@style/Button"
android:onClick="onSignInClick"/>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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"
tools:context=".ui.MainActivity">
<com.jachdev.consumerprotection.ui.widget.HeaderView
android:id="@+id/headerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:text="@string/app_name" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/headerView" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:paddingBottom="50dp"
android:fitsSystemWindows="false"
tools:context=".ui.SignUpActivity">
<com.jachdev.consumerprotection.ui.widget.HeaderView
android:id="@+id/headerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:text="@string/sign_up" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/headerView">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/medium">
<com.jachdev.commonlibs.widget.CustomEditText
android:id="@+id/et_name"
style="@style/EditText"
android:hint="@string/name"
android:inputType="textPersonName|textCapWords"
app:fontType="@string/font_para"
app:layout_constraintTop_toBottomOf="@+id/headerView" />
<com.jachdev.commonlibs.widget.CustomEditText
android:id="@+id/et_email"
style="@style/EditText"
android:layout_marginTop="@dimen/medium"
android:hint="@string/email"
android:inputType="textEmailAddress"
app:fontType="@string/font_para"
app:layout_constraintTop_toBottomOf="@+id/headerView" />
<com.jachdev.commonlibs.widget.CustomEditText
android:id="@+id/et_phone"
style="@style/EditText"
android:layout_marginTop="@dimen/medium"
android:hint="@string/phone_number"
android:inputType="phone"
app:fontType="@string/font_para"
app:layout_constraintTop_toBottomOf="@+id/headerView" />
<com.jachdev.commonlibs.widget.CustomEditText
android:id="@+id/et_password"
style="@style/EditText"
android:layout_marginTop="@dimen/medium"
android:hint="@string/password"
android:inputType="textPassword"
app:fontType="@string/font_para"
app:layout_constraintTop_toBottomOf="@+id/headerView" />
<com.jachdev.commonlibs.widget.CustomEditText
android:id="@+id/et_confirm_password"
style="@style/EditText"
android:layout_marginTop="@dimen/medium"
android:hint="@string/confirm_password"
android:inputType="textPassword"
app:fontType="@string/font_para"
app:layout_constraintTop_toBottomOf="@+id/headerView" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.jachdev.commonlibs.widget.CustomTextView
app:fontType="@string/font_para"
android:layout_marginTop="@dimen/medium"
android:layout_weight="1"
android:text="@string/sign_up_as"
style="@style/TextView" />
<com.jachdev.commonlibs.widget.CustomTextView
android:id="@+id/tv_user_type"
app:fontType="@string/font_header"
android:layout_marginTop="@dimen/medium"
android:text="@string/consumer"
style="@style/TextView" />
</LinearLayout>
<RadioGroup
android:id="@+id/rg_user_type"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginTop="@dimen/medium">
<RadioButton
android:id="@+id/rb_consumer"
android:button="@drawable/bg_consumer_selector"
android:layout_margin="@dimen/medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/rb_vendor"
android:button="@drawable/bg_vendor_selector"
android:layout_margin="@dimen/medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<RadioButton
android:id="@+id/rb_admin"
android:button="@drawable/bg_admin_selector"
android:layout_margin="@dimen/medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RadioGroup>
<com.jachdev.commonlibs.widget.CustomButton
android:layout_marginTop="@dimen/medium"
app:fontType="@string/font_para"
android:text="@string/sign_up"
style="@style/Button"
android:onClick="onSignUnClick"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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"
tools:context=".ui.home.HomeFragment">
<com.jachdev.commonlibs.widget.CustomTextView
android:id="@+id/tv_header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/medium"
android:gravity="center|start"
android:maxLines="2"
android:textAlignment="textStart"
android:textColor="@color/colorPrimaryText"
android:textSize="24sp"
app:fontType="@string/font_header"
app:layout_constraintEnd_toStartOf="@+id/circleImageView2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.jachdev.commonlibs.widget.CircleImageView
android:id="@+id/circleImageView2"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_margin="@dimen/medium"
android:src="@drawable/ic_user"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_header">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/medium"
android:orientation="vertical">
<com.jachdev.commonlibs.widget.CustomButton
android:id="@+id/btn_image_rec"
android:layout_marginTop="@dimen/medium"
app:fontType="@string/font_para"
android:text="Image Recognition"
style="@style/Button"/>
<com.jachdev.commonlibs.widget.CustomButton
android:id="@+id/btn_calorie_count"
android:layout_marginTop="@dimen/medium"
app:fontType="@string/font_para"
android:text="Calorie Counter"
style="@style/Button"/>
<com.jachdev.commonlibs.widget.CustomButton
android:id="@+id/btn_meal_plan"
android:layout_marginTop="@dimen/medium"
app:fontType="@string/font_para"
android:text="Meal Plan"
style="@style/Button"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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/menu_main_setting2"
android:icon="@drawable/ic_logout"
android:orderInCategory="200"
app:showAsAction="always"
android:title="Logout" />
</menu>
\ No newline at end of file
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