mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-02-07 21:24:36 +01:00
Mark current week (#100)
This commit is contained in:
parent
d7f0fcad30
commit
67f83a4d2f
@ -17,6 +17,8 @@ public interface AttendanceContract {
|
|||||||
void setAdapterWithTabLayout();
|
void setAdapterWithTabLayout();
|
||||||
|
|
||||||
boolean isMenuVisible();
|
boolean isMenuVisible();
|
||||||
|
|
||||||
|
void setThemeForTab(int position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PerActivity
|
@PerActivity
|
||||||
|
@ -80,6 +80,14 @@ public class AttendanceFragment extends BaseFragment implements AttendanceContra
|
|||||||
viewPager.setCurrentItem(position, false);
|
viewPager.setCurrentItem(position, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setThemeForTab(int position) {
|
||||||
|
TabLayout.Tab tab = tabLayout.getTabAt(position);
|
||||||
|
if (tab != null) {
|
||||||
|
tab.setCustomView(R.layout.current_week_tab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setActivityTitle() {
|
public void setActivityTitle() {
|
||||||
setTitle(getString(R.string.attendance_text));
|
setTitle(getString(R.string.attendance_text));
|
||||||
|
@ -80,6 +80,7 @@ public class AttendancePresenter extends BasePresenter<AttendanceContract.View>
|
|||||||
public void onEndLoadingAsync(boolean result, Exception exception) {
|
public void onEndLoadingAsync(boolean result, Exception exception) {
|
||||||
if (result) {
|
if (result) {
|
||||||
getView().setAdapterWithTabLayout();
|
getView().setAdapterWithTabLayout();
|
||||||
|
getView().setThemeForTab(positionToScroll);
|
||||||
getView().scrollViewPagerToPosition(positionToScroll);
|
getView().scrollViewPagerToPosition(positionToScroll);
|
||||||
listener.onFragmentIsReady();
|
listener.onFragmentIsReady();
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@ public interface ExamsContract {
|
|||||||
void setTabDataToAdapter(String date);
|
void setTabDataToAdapter(String date);
|
||||||
|
|
||||||
void setAdapterWithTabLayout();
|
void setAdapterWithTabLayout();
|
||||||
|
|
||||||
|
void setThemeForTab(int position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PerActivity
|
@PerActivity
|
||||||
|
@ -73,6 +73,14 @@ public class ExamsFragment extends BaseFragment implements ExamsContract.View {
|
|||||||
viewPager.setCurrentItem(position, false);
|
viewPager.setCurrentItem(position, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setThemeForTab(int position) {
|
||||||
|
TabLayout.Tab tab = tabLayout.getTabAt(position);
|
||||||
|
if (tab != null) {
|
||||||
|
tab.setCustomView(R.layout.current_week_tab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTabDataToAdapter(String date) {
|
public void setTabDataToAdapter(String date) {
|
||||||
pagerAdapter.addFragment(ExamsTabFragment.newInstance(date), date);
|
pagerAdapter.addFragment(ExamsTabFragment.newInstance(date), date);
|
||||||
|
@ -84,6 +84,7 @@ public class ExamsPresenter extends BasePresenter<ExamsContract.View>
|
|||||||
public void onEndLoadingAsync(boolean result, Exception exception) {
|
public void onEndLoadingAsync(boolean result, Exception exception) {
|
||||||
if (result) {
|
if (result) {
|
||||||
getView().setAdapterWithTabLayout();
|
getView().setAdapterWithTabLayout();
|
||||||
|
getView().setThemeForTab(positionToScroll);
|
||||||
getView().scrollViewPagerToPosition(positionToScroll);
|
getView().scrollViewPagerToPosition(positionToScroll);
|
||||||
listener.onFragmentIsReady();
|
listener.onFragmentIsReady();
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@ public interface TimetableContract {
|
|||||||
void setAdapterWithTabLayout();
|
void setAdapterWithTabLayout();
|
||||||
|
|
||||||
boolean isMenuVisible();
|
boolean isMenuVisible();
|
||||||
|
|
||||||
|
void setThemeForTab(int position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PerFragment
|
@PerFragment
|
||||||
|
@ -78,6 +78,14 @@ public class TimetableFragment extends BaseFragment implements TimetableContract
|
|||||||
viewPager.setCurrentItem(position, false);
|
viewPager.setCurrentItem(position, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setThemeForTab(int position) {
|
||||||
|
TabLayout.Tab tab = tabLayout.getTabAt(position);
|
||||||
|
if (tab != null) {
|
||||||
|
tab.setCustomView(R.layout.current_week_tab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setActivityTitle() {
|
public void setActivityTitle() {
|
||||||
setTitle(getString(R.string.timetable_text));
|
setTitle(getString(R.string.timetable_text));
|
||||||
|
@ -79,6 +79,7 @@ public class TimetablePresenter extends BasePresenter<TimetableContract.View>
|
|||||||
public void onEndLoadingAsync(boolean result, Exception exception) {
|
public void onEndLoadingAsync(boolean result, Exception exception) {
|
||||||
if (result) {
|
if (result) {
|
||||||
getView().setAdapterWithTabLayout();
|
getView().setAdapterWithTabLayout();
|
||||||
|
getView().setThemeForTab(positionToScroll);
|
||||||
getView().scrollViewPagerToPosition(positionToScroll);
|
getView().scrollViewPagerToPosition(positionToScroll);
|
||||||
listener.onFragmentIsReady();
|
listener.onFragmentIsReady();
|
||||||
}
|
}
|
||||||
|
8
app/src/main/res/layout/current_week_tab.xml
Normal file
8
app/src/main/res/layout/current_week_tab.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@android:id/text1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@color/colorPrimaryDark"
|
||||||
|
android:textSize="14sp" />
|
Loading…
x
Reference in New Issue
Block a user