From 2bf8e3b87e3033ff211e817fb84f21c0f224d4ff Mon Sep 17 00:00:00 2001 From: cyberarm Date: Thu, 12 Nov 2020 07:47:56 -0600 Subject: [PATCH] Moved website button from Launcher to Settings, added source code button to Settings as well --- .../LauncherActivity.java | 9 ------- .../ui/settings/SettingsFragment.java | 20 ++++++++++++++++ app/src/main/res/layout/activity_launcher.xml | 16 ------------- app/src/main/res/layout/fragment_settings.xml | 24 +++++++++++++++++++ 4 files changed, 44 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/org/timecrafters/TimeCraftersConfigurationTool/LauncherActivity.java b/app/src/main/java/org/timecrafters/TimeCraftersConfigurationTool/LauncherActivity.java index fc69c3d..f6981ca 100644 --- a/app/src/main/java/org/timecrafters/TimeCraftersConfigurationTool/LauncherActivity.java +++ b/app/src/main/java/org/timecrafters/TimeCraftersConfigurationTool/LauncherActivity.java @@ -37,15 +37,6 @@ public class LauncherActivity extends AppCompatActivity { getSupportActionBar().hide(); } - Button websiteButton = findViewById(R.id.timecrafters_website_button); - websiteButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://timecrafters.org")); - startActivity(browserIntent); - } - }); - if (havePermissions()) { if (Backend.instance() == null) { new Backend(); diff --git a/app/src/main/java/org/timecrafters/TimeCraftersConfigurationTool/ui/settings/SettingsFragment.java b/app/src/main/java/org/timecrafters/TimeCraftersConfigurationTool/ui/settings/SettingsFragment.java index 6c9c45c..92d3bd7 100644 --- a/app/src/main/java/org/timecrafters/TimeCraftersConfigurationTool/ui/settings/SettingsFragment.java +++ b/app/src/main/java/org/timecrafters/TimeCraftersConfigurationTool/ui/settings/SettingsFragment.java @@ -1,5 +1,7 @@ package org.timecrafters.TimeCraftersConfigurationTool.ui.settings; +import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -28,6 +30,8 @@ public class SettingsFragment extends TimeCraftersFragment { final Switch showNavigationLabels = root.findViewById(R.id.show_navigation_labels); final Switch disableLauncherDelay = root.findViewById(R.id.disable_launcher_delay); final Switch startServerAtBoot = root.findViewById(R.id.start_server_at_boot); + final Button websiteButton = root.findViewById(R.id.timecrafters_website_button); + final Button sourceCodeButton = root.findViewById(R.id.timecrafters_configuration_tool_source_code_button); final BottomNavigationView navView = getActivity().findViewById(R.id.nav_view); @@ -90,6 +94,22 @@ public class SettingsFragment extends TimeCraftersFragment { } }); + websiteButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://timecrafters.org")); + startActivity(browserIntent); + } + }); + + sourceCodeButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/TimeCrafters/TimeCraftersConfigurationTool")); + startActivity(browserIntent); + } + }); + return root; } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_launcher.xml b/app/src/main/res/layout/activity_launcher.xml index c0eb69a..ba41c26 100644 --- a/app/src/main/res/layout/activity_launcher.xml +++ b/app/src/main/res/layout/activity_launcher.xml @@ -27,20 +27,4 @@ app:layout_constraintTop_toTopOf="parent" app:srcCompat="@mipmap/ic_launcher_foreground" /> -