Skip to content

Commit

Permalink
Version 0.6.0 (600)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgudim committed Jan 22, 2023
1 parent d5379d6 commit 8c6d1e9
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 27 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'com.android.application'

def versionMajor = 0
def versionMinor = 5
def versionPatch = 9
def versionMinor = 6
def versionPatch = 0
def globalSuffix = ""

ext.getVersionCode = { ->
Expand Down Expand Up @@ -54,8 +54,8 @@ android {
}

compileOptions {
targetCompatibility JavaVersion.VERSION_1_9
sourceCompatibility JavaVersion.VERSION_1_9
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_11
}

namespace 'prototype.xd.scheduler'
Expand Down
40 changes: 23 additions & 17 deletions app/src/main/java/prototype/xd/scheduler/HomeFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.google.android.material.navigation.NavigationView;

import java.io.File;
import java.io.IOException;
import java.time.LocalDate;
Expand All @@ -50,6 +52,7 @@
import prototype.xd.scheduler.databinding.ContentWrapperBinding;
import prototype.xd.scheduler.databinding.DebugMenuDialogBinding;
import prototype.xd.scheduler.databinding.HomeFragmentWrapperBinding;
import prototype.xd.scheduler.databinding.NavigationViewBinding;
import prototype.xd.scheduler.entities.Group;
import prototype.xd.scheduler.entities.TodoEntry;
import prototype.xd.scheduler.utilities.ContextWrapper;
Expand Down Expand Up @@ -87,6 +90,8 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c

HomeFragmentWrapperBinding wrapperBnd = HomeFragmentWrapperBinding.inflate(inflater, container, false);
contentBnd = wrapperBnd.contentWrapper;
NavigationView navViewDrawer = wrapperBnd.navViewWrapper;
NavigationViewBinding navViewContent = wrapperBnd.navView;

contentBnd.content.recyclerView.setItemAnimator(null);
contentBnd.content.recyclerView.setLayoutManager(new LinearLayoutManager(wrapper.context));
Expand Down Expand Up @@ -121,7 +126,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, slideOffset);
// move all content to the right when drawer opens
float moveFactor = wrapperBnd.navViewWrapper.getWidth() * slideOffset / 3;
float moveFactor = navViewDrawer.getWidth() * slideOffset / 3;
contentBnd.getRoot().setTranslationX(moveFactor);
contentBnd.getRoot().setScaleX(1 - slideOffset / 20);
contentBnd.getRoot().setScaleY(1 - slideOffset / 20);
Expand All @@ -133,8 +138,8 @@ public void onDrawerSlide(View drawerView, float slideOffset) {
rootActivity.getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), new OnBackPressedCallback(true) {
@Override
public void handleOnBackPressed() {
if (drawerLayout.isDrawerOpen(wrapperBnd.navViewWrapper)) {
drawerLayout.closeDrawer(wrapperBnd.navViewWrapper);
if (drawerLayout.isDrawerOpen(navViewDrawer)) {
drawerLayout.closeDrawer(navViewDrawer);
} else {
// prevent stack overflow
setEnabled(false);
Expand All @@ -161,14 +166,14 @@ public void handleOnBackPressed() {
todoEntryManager.addEntry(new TodoEntry(values, groupList.get(selectedIndex), System.currentTimeMillis()));
});
});
wrapperBnd.navView.sourceCodeClickView.setOnClickListener(v -> Utilities.openUrl(wrapper.context, GITHUB_REPO));
wrapperBnd.navView.githubIssueClickView.setOnClickListener(v -> Utilities.openUrl(wrapper.context, GITHUB_ISSUES));
wrapperBnd.navView.latestReleaseClickView.setOnClickListener(v -> Utilities.openUrl(wrapper.context, GITHUB_RELEASES));
wrapperBnd.navView.userGuideClickView.setOnClickListener(v -> displayToast(wrapper.context, R.string.work_in_progress));
wrapperBnd.navView.logo.setOnClickListener(v ->

navViewContent.sourceCodeClickView.setOnClickListener(v -> Utilities.openUrl(wrapper.context, GITHUB_REPO));
navViewContent.githubIssueClickView.setOnClickListener(v -> Utilities.openUrl(wrapper.context, GITHUB_ISSUES));
navViewContent.latestReleaseClickView.setOnClickListener(v -> Utilities.openUrl(wrapper.context, GITHUB_RELEASES));

navViewContent.userGuideClickView.setOnClickListener(v -> displayToast(wrapper.context, R.string.work_in_progress));

navViewContent.logo.setOnClickListener(v ->
displayMessageDialog(wrapper, builder -> {
builder.setTitle(R.string.debug_menu);
builder.setMessage(R.string.debug_menu_description);
Expand All @@ -190,16 +195,17 @@ public void handleOnBackPressed() {
builder.setPositiveButton(R.string.close, null);
})
);
wrapperBnd.navView.globalSettingsClickView.setOnClickListener(v ->

navViewContent.globalSettingsClickView.setOnClickListener(v ->
Utilities.navigateToFragment(rootActivity, R.id.action_HomeFragment_to_GlobalSettingsFragment));
wrapperBnd.navView.calendarSettingsClickView.setOnClickListener(v ->

navViewContent.calendarSettingsClickView.setOnClickListener(v ->
Utilities.navigateToFragment(rootActivity, R.id.action_HomeFragment_to_CalendarSettingsFragment));
wrapperBnd.navView.sortingSettingsClickView.setOnClickListener(v ->

navViewContent.sortingSettingsClickView.setOnClickListener(v ->
Utilities.navigateToFragment(rootActivity, R.id.action_HomeFragment_to_SortingSettingsFragment));


return wrapperBnd.getRoot();
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/prototype/xd/scheduler/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}*/
//}

Keys.initPrefs(this);
Keys.init(this);

File rootDir = getExternalFilesDir("");
if (rootDir == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public boolean equals(@Nullable Object obj) {
}
}

public static synchronized void initPrefs(@NonNull Context context) {
public static synchronized void init(@NonNull Context context) {
if (preferences == null) {
preferences = context.getSharedPreferences(PREFERENCES_MAIN, Context.MODE_PRIVATE);
servicePreferences = context.getSharedPreferences(PREFERENCES_SERVICE, Context.MODE_PRIVATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private void updateNotification() {

@Override
public int onStartCommand(@Nullable Intent intent, int flags, int startId) {
Keys.initPrefs(this);
Keys.init(this);
if (intent != null && initialized) {
if (intent.hasExtra(SERVICE_KEEP_ALIVE_SIGNAL)) {
setBitmapUpdateFlag();
Expand Down
12 changes: 12 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/600.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Bugfixes:
- Serialization, deserialization bugfixes
- Fixed a memory leak in TodoEntry
- A bunch of minor fixes

Misc:
- Tweaked views
- Added debug menu with log sharing

Internal changes:
- Annotated a bunch of functions

6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun May 09 13:56:31 MSK 2021
#Sun Jan 22 12:37:23 MSK 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 8c6d1e9

Please sign in to comment.