From b81e479a8d020be3fe4bc5c4aedca8af147170e0 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 20 Feb 2025 10:49:21 +0300 Subject: [PATCH] version3.2(with all layouts) --- app/build.gradle.kts | 3 + .../ui/profile/RedactProfileFragment.java | 38 ++++ .../ui/profile/RedactProfileViewModel.java | 7 + .../work/ui/userlist/CompanyInfoFragment.java | 38 ++++ .../ui/userlist/CompanyInfoViewModel.java | 7 + app/src/main/res/drawable/contacts.png | Bin 0 -> 431 bytes app/src/main/res/drawable/ic_address.png | Bin 0 -> 487 bytes app/src/main/res/drawable/info.png | Bin 0 -> 499 bytes .../main/res/layout/company_info_fragment.xml | 195 ++++++++++++------ app/src/main/res/menu/bottom_nav_menu.xml | 25 +-- app/src/main/res/values/strings.xml | 3 + 11 files changed, 239 insertions(+), 77 deletions(-) create mode 100644 app/src/main/java/ru/myitschool/work/ui/profile/RedactProfileFragment.java create mode 100644 app/src/main/java/ru/myitschool/work/ui/profile/RedactProfileViewModel.java create mode 100644 app/src/main/java/ru/myitschool/work/ui/userlist/CompanyInfoFragment.java create mode 100644 app/src/main/java/ru/myitschool/work/ui/userlist/CompanyInfoViewModel.java create mode 100644 app/src/main/res/drawable/contacts.png create mode 100644 app/src/main/res/drawable/ic_address.png create mode 100644 app/src/main/res/drawable/info.png diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 705a308..66553b5 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -39,6 +39,9 @@ dependencies { implementation("com.google.android.material:material:1.12.0") implementation("androidx.activity:activity:1.10.0") implementation("androidx.constraintlayout:constraintlayout:2.2.0") + implementation("androidx.legacy:legacy-support-v4:1.0.0") + implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.7") + implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7") defaultLibrary() implementation(Dependencies.AndroidX.activity) implementation(Dependencies.AndroidX.fragment) diff --git a/app/src/main/java/ru/myitschool/work/ui/profile/RedactProfileFragment.java b/app/src/main/java/ru/myitschool/work/ui/profile/RedactProfileFragment.java new file mode 100644 index 0000000..d191f01 --- /dev/null +++ b/app/src/main/java/ru/myitschool/work/ui/profile/RedactProfileFragment.java @@ -0,0 +1,38 @@ +package ru.myitschool.work.ui.profile; + +import androidx.lifecycle.ViewModelProvider; + +import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import ru.myitschool.work.R; + +public class RedactProfileFragment extends Fragment { + + private RedactProfileViewModel mViewModel; + + public static RedactProfileFragment newInstance() { + return new RedactProfileFragment(); + } + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { + return inflater.inflate(R.layout.fragment_redact_profile, container, false); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + mViewModel = new ViewModelProvider(this).get(RedactProfileViewModel.class); + // TODO: Use the ViewModel + } + +} \ No newline at end of file diff --git a/app/src/main/java/ru/myitschool/work/ui/profile/RedactProfileViewModel.java b/app/src/main/java/ru/myitschool/work/ui/profile/RedactProfileViewModel.java new file mode 100644 index 0000000..b06e10e --- /dev/null +++ b/app/src/main/java/ru/myitschool/work/ui/profile/RedactProfileViewModel.java @@ -0,0 +1,7 @@ +package ru.myitschool.work.ui.profile; + +import androidx.lifecycle.ViewModel; + +public class RedactProfileViewModel extends ViewModel { + // TODO: Implement the ViewModel +} \ No newline at end of file diff --git a/app/src/main/java/ru/myitschool/work/ui/userlist/CompanyInfoFragment.java b/app/src/main/java/ru/myitschool/work/ui/userlist/CompanyInfoFragment.java new file mode 100644 index 0000000..8c78ba5 --- /dev/null +++ b/app/src/main/java/ru/myitschool/work/ui/userlist/CompanyInfoFragment.java @@ -0,0 +1,38 @@ +package ru.myitschool.work.ui.userlist; + +import androidx.lifecycle.ViewModelProvider; + +import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import ru.myitschool.work.R; + +public class CompanyInfoFragment extends Fragment { + + private CompanyInfoViewModel mViewModel; + + public static CompanyInfoFragment newInstance() { + return new CompanyInfoFragment(); + } + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, + @Nullable Bundle savedInstanceState) { + return inflater.inflate(R.layout.company_info_fragment, container, false); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + mViewModel = new ViewModelProvider(this).get(CompanyInfoViewModel.class); + // TODO: Use the ViewModel + } + +} \ No newline at end of file diff --git a/app/src/main/java/ru/myitschool/work/ui/userlist/CompanyInfoViewModel.java b/app/src/main/java/ru/myitschool/work/ui/userlist/CompanyInfoViewModel.java new file mode 100644 index 0000000..708da7d --- /dev/null +++ b/app/src/main/java/ru/myitschool/work/ui/userlist/CompanyInfoViewModel.java @@ -0,0 +1,7 @@ +package ru.myitschool.work.ui.userlist; + +import androidx.lifecycle.ViewModel; + +public class CompanyInfoViewModel extends ViewModel { + // TODO: Implement the ViewModel +} \ No newline at end of file diff --git a/app/src/main/res/drawable/contacts.png b/app/src/main/res/drawable/contacts.png new file mode 100644 index 0000000000000000000000000000000000000000..b853acfa0d6c5f09bfdc5336738b03d4bd470e51 GIT binary patch literal 431 zcmV;g0Z{&lP)o1DxnGw<@=%-aQWWF|gD*rrLAi1* Zr+OA?RX>Xqat{Ci002ovPDHLkV1ko!xyS$j literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable/ic_address.png b/app/src/main/res/drawable/ic_address.png new file mode 100644 index 0000000000000000000000000000000000000000..499c0e1408ef711e52820c6134ec93b8ffc78a22 GIT binary patch literal 487 zcmVVtjz5!gNAmZXfV5=A98 zsMr+EN&l)g$d&BG8*7O5z;`QuG+n|jnbVjO8739kqn_WyUZ4fFTFM^s;PofT6S*PR z4&Yl+u(IlMI^c9 zH3`*Z=h1u*CCF~^Rq`e~he$F%Y>vEHnrUwgfjy&`3fliXeM_!Ni<)o<*=6W(_s>$0 zWHh-qu4&?4jhTIuYHTftjV`xox0OH_?CCQ0j(pKStf5M350pq(Xl~J z$t#&c&JEncI%$zHZyjD>g}jrsfZy-cWYdNyh6SVp%TtL?~J zPfT3bbr1B&G5*S`2CM{Zl3)|*LuJX@#u(b&NtC01J7t{QcuB3CkZm&If{Zx*mQ*B} zltL3>`6PQ}Oa1cXicA+49@1-{>-?+0Pj1wfWOrn~z^T`UB6H-y2Dy{?Qd4^^V2f;g zqzQJ(Mj)Bg+>_3wK>gPhe<`U$o4th2=@KuQtiK_Bxw2=2iHmH)Iy&De4kWgEVouwD zSL`mUeDn{5Kf3i3drSR8e%W;=$qP9ni%2_!YeCYIE|9jUD*9-mZubSG4oLtY+J9wGn$002ovPDHLkV1kTV)4Tux literal 0 HcmV?d00001 diff --git a/app/src/main/res/layout/company_info_fragment.xml b/app/src/main/res/layout/company_info_fragment.xml index d7c2ccc..8e88fef 100644 --- a/app/src/main/res/layout/company_info_fragment.xml +++ b/app/src/main/res/layout/company_info_fragment.xml @@ -45,9 +45,9 @@ + android:layout_marginStart="20dp" + android:layout_marginTop="14dp" + android:layout_marginEnd="38dp" + android:maxLines="1" /> + + + + + + + + + + + + + + + + + android:background="@drawable/contacts" /> + + + + + android:layout_marginStart="10dp" + android:layout_marginTop="5dp" + android:layout_marginEnd="10dp" + android:background="#B1B1CF"> + + + + android:layout_marginStart="50dp" + android:layout_marginTop="37dp" + android:layout_marginEnd="36dp" + android:maxLines="1" /> - - + android:layout_marginStart="50dp" + android:layout_marginTop="-54dp" + android:layout_marginEnd="301dp" + android:text="@string/address" /> - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml index 6e945f7..e2ac096 100644 --- a/app/src/main/res/menu/bottom_nav_menu.xml +++ b/app/src/main/res/menu/bottom_nav_menu.xml @@ -1,18 +1,6 @@ - - + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eedaaac..cc94ce0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -36,4 +36,7 @@ Изменить фото профиля Настройка профиля Информация о компании + Адрес + Контакты + Описание \ No newline at end of file