Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F15183840
D251.1794986998.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Unknown
Size
12 KB
Referenced Files
None
Subscribers
None
D251.1794986998.diff
View Options
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -56,7 +56,7 @@
<activity
android:name=".ActivityIntro"
android:exported="false"
- android:theme="@style/AppThemeDayNight.NoActionBar"
+ android:theme="@style/AppThemeIntro"
/>
<activity
android:name=".ActivityExperiments"
@@ -76,36 +76,12 @@
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
-
- <category android:name="android.intent.category.DEFAULT"/>
- <category android:name="android.intent.category.BROWSABLE"/>
-
- <data
- android:host="www.gtt.to.it"
- android:pathPrefix="/cms/percorari/arrivi"
- android:scheme="http"/>
- </intent-filter>
- <intent-filter>
- <action android:name="android.intent.action.VIEW"/>
-
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
-
- <data
- android:host="gtt.to.it"
- android:pathPrefix="/cms/percorari/arrivi"
- android:scheme="http"/>
- </intent-filter>
- <intent-filter>
- <action android:name="android.intent.action.VIEW"/>
-
- <category android:name="android.intent.category.DEFAULT"/>
- <category android:name="android.intent.category.BROWSABLE"/>
-
- <data
- android:host="m.gtt.to.it"
- android:pathPrefix="/m/it/arrivi.jsp"
- android:scheme="http"/>
+ <data android:scheme="http" />
+ <data android:scheme="https" />
+ <data android:host="www.gtt.to.it" />
+ <data android:pathPrefix="/cms/percorari/arrivi" />
</intent-filter>
</activity>
<activity
diff --git a/app/src/main/java/it/reyboz/bustorino/ActivityPrincipal.java b/app/src/main/java/it/reyboz/bustorino/ActivityPrincipal.java
--- a/app/src/main/java/it/reyboz/bustorino/ActivityPrincipal.java
+++ b/app/src/main/java/it/reyboz/bustorino/ActivityPrincipal.java
@@ -76,6 +76,27 @@
private ServiceAlertsViewModel serviceAlertsViewModel;
+
+ private final DrawerLayout.DrawerListener drawerListener = new DrawerLayout.DrawerListener() {
+ @Override
+ public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {
+
+ }
+
+ @Override
+ public void onDrawerOpened(@NonNull View drawerView) {
+ hideKeyboard();
+ }
+
+ @Override
+ public void onDrawerClosed(@NonNull View drawerView) {
+
+ }
+
+ @Override
+ public void onDrawerStateChanged(int newState) {
+ }
+ };
//private FragmentKind showingFragmentKind;
private final Map<Integer, Runnable> menuActions = Map.of(
@@ -132,7 +153,7 @@
//onBackPressed solution required from Android 16
backPressedCallback.setEnabled(true);
this.getOnBackPressedDispatcher().addCallback(backPressedCallback);
- boolean showingArrivalsFromIntent = false;
+ //boolean showingArrivalsFromIntent = false;
final Toolbar mToolbar = findViewById(R.id.default_toolbar);
setSupportActionBar(mToolbar);
@@ -150,27 +171,7 @@
drawerToggle.syncState();
mDrawer.addDrawerListener(drawerToggle);
- mDrawer.addDrawerListener(new DrawerLayout.DrawerListener() {
- @Override
- public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {
-
- }
-
- @Override
- public void onDrawerOpened(@NonNull View drawerView) {
- hideKeyboard();
- }
-
- @Override
- public void onDrawerClosed(@NonNull View drawerView) {
-
- }
-
- @Override
- public void onDrawerStateChanged(int newState) {
- }
- });
-
+ mDrawer.addDrawerListener(drawerListener);
mNavView = findViewById(R.id.nvView);
@@ -186,32 +187,38 @@
// Intercept calls from URL intent
boolean tryedFromIntent = false;
- String busStopID = null;
- Uri data = getIntent().getData();
- if (data != null) {
-
- busStopID = getBusStopIDFromUri(data);
- Log.d(DEBUG_TAG, "Opening Intent: busStopID: "+busStopID);
- tryedFromIntent = true;
- }
+ String initialBusStopID = null;
+ var intent = getIntent();
+ if(intent != null){
+ var data = intent.getData();
+ if(data != null){
+ //var rest = data.getSchemeSpecificPart();
+ //Log.d(DEBUG_TAG, "the rest is: "+rest);
- // Intercept calls from other activities
- if (!tryedFromIntent) {
- Bundle b = getIntent().getExtras();
- if (b != null) {
- busStopID = b.getString("bus-stop-ID");
+ initialBusStopID = getBusStopIDFromUri(data);
+ tryedFromIntent = true;
+ Log.d(DEBUG_TAG, "Opening Intent: initialBusStopID: "+initialBusStopID);
- /*
- * I'm not very sure if you are coming from an Intent.
- * Some launchers work in strange ways.
- */
- tryedFromIntent = busStopID != null;
+ }
+ // Intercept calls from other activities
+ if(!tryedFromIntent){
+ Bundle b =intent.getExtras();
+ if (b != null) {
+ initialBusStopID = b.getString("bus-stop-ID");
+
+ /*
+ * I'm not very sure if you are coming from an Intent.
+ * Some launchers work in strange ways.
+ */
+ tryedFromIntent = initialBusStopID != null;
+ }
}
}
+
//---------------------------- END INTENT CHECK QUEUE --------------------------------------
- if (busStopID == null) {
+ if (initialBusStopID == null) {
// Show keyboard if can't start from intent
// JUST DON'T
// showKeyboard();
@@ -223,12 +230,6 @@
Toast.makeText(getApplicationContext(),
R.string.insert_bus_stop_number_error, Toast.LENGTH_SHORT).show();
}
- } else {
- // If you are here an intent has worked successfully
- //setBusStopSearchByIDEditText(busStopID);
- //Log.d(DEBUG_TAG, "Requesting arrivals for stop "+busStopID+" from intent");
- requestArrivalsForStopID(busStopID); //this shows the fragment, too
- showingArrivalsFromIntent = true;
}
//database check
@@ -268,10 +269,12 @@
String vl = PreferenceManager.getDefaultSharedPreferences(this).getString(SettingsFragment.PREF_KEY_STARTUP_SCREEN, "");
Log.d(DEBUG_TAG, "The default screen to open is: "+vl);
- if (showingArrivalsFromIntent){
- //do nothing but exclude a case
+ var framan = getSupportFragmentManager();
+
+ if (initialBusStopID!=null) {
+ Log.d(DEBUG_TAG, "Opening Main Fragment on arrivals, bus Stop: "+initialBusStopID);
+ createShowMainFragment(framan, MainScreenFragment.makeArgsArrivals(initialBusStopID), false);
}else if (savedInstanceState==null) {
- var framan = getSupportFragmentManager();
//we are not restarting the activity from nothing
switch (vl){
case "map" -> {requestMapFragment(false);}
diff --git a/app/src/main/java/it/reyboz/bustorino/fragments/MainScreenFragment.java b/app/src/main/java/it/reyboz/bustorino/fragments/MainScreenFragment.java
--- a/app/src/main/java/it/reyboz/bustorino/fragments/MainScreenFragment.java
+++ b/app/src/main/java/it/reyboz/bustorino/fragments/MainScreenFragment.java
@@ -413,6 +413,7 @@
break;
case ARRIVALS:
// pendingStopID is consumed in onResume → requestArrivalsForStopID
+ swipeRefreshLayout.setVisibility(View.VISIBLE);
break;
case STOP_SEARCH:
if (pendingSearchQuery != null && pendingSearchQuery.length() >= 2) {
diff --git a/app/src/main/res/values-night-v27/themes.xml b/app/src/main/res/values-night-v27/themes.xml
new file mode 100644
--- /dev/null
+++ b/app/src/main/res/values-night-v27/themes.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="AppThemeIntro" parent="AppThemeDayNight.NoActionBar">
+ <item name="android:windowLightStatusBar">false</item>
+ <item name="android:windowLightNavigationBar">true</item>
+ </style>
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
--- a/app/src/main/res/values-night/themes.xml
+++ b/app/src/main/res/values-night/themes.xml
@@ -1,11 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
+ <!-- REMEMBER TO COPY COLORS in values-v27-night -->
+
<style name="AppThemeDayNight" parent="Theme.MaterialComponents.DayNight">
<item name="android:textColorSecondary">@color/text_secondary_night</item>
<item name="colorPrimary">@color/orange_500_night</item>
<item name="colorPrimaryDark">@color/orange_700_night</item>
<item name="colorAccent">@color/teal_500_night</item>
+ </style>
+ <style name="AppThemeIntro" parent="AppThemeDayNight.NoActionBar">
+ <item name="android:windowLightStatusBar">false</item>
</style>
</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values-v19/styles.xml b/app/src/main/res/values-v19/styles.xml
deleted file mode 100644
--- a/app/src/main/res/values-v19/styles.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <style name="AppTheme.NoActionBar" parent="AppTheme">
-
- <item name="android:windowTranslucentStatus">false</item>
-
- <item name="windowActionBar">false</item>
- <item name="windowNoTitle">true</item>
- </style>
-</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values-v27/styles.xml b/app/src/main/res/values-v27/styles.xml
new file mode 100644
--- /dev/null
+++ b/app/src/main/res/values-v27/styles.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="AppThemeDayNight" parent="Theme.MaterialComponents.DayNight">
+
+ <item name="colorPrimary">@color/orange_500</item>
+ <item name="colorPrimaryDark">@color/orange_700</item>
+ <item name="colorAccent">@color/teal_500</item>
+ <item name="colorOnPrimary">@color/white</item>
+
+ <item name="android:textColor">@color/black_800</item>
+
+ <item name="android:windowLightNavigationBar">true</item>
+
+ </style>
+ <style name="AppThemeIntro" parent="AppThemeDayNight.NoActionBar">
+ <item name="android:windowLightStatusBar">true</item>
+
+ <item name="android:windowLightNavigationBar">true</item>
+
+ </style>
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values-v35/styles.xml b/app/src/main/res/values-v35/styles.xml
deleted file mode 100644
--- a/app/src/main/res/values-v35/styles.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<resources>
-
-
-</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -79,15 +79,13 @@
<item name="colorPrimaryDark">@color/orange_700</item>
<item name="colorAccent">@color/teal_500</item>
<item name="colorOnPrimary">@color/white</item>
+ <!-- REMEMBER TO COPY THEM in values-v27 -->
<!-- For the preferences Fragment -->
<!--<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>-->
<item name="android:textColor">@color/black_800</item>
- <!-- keep default for day, change for night-->
- <!--
- <item name="android:textColorPrimary">@color/grey_700</item>
- <item name="android:textColorSecondary">@color/text_secondary</item>
- -->
+ <item name="android:windowLightStatusBar">false</item>
+
</style>
<style name="AppThemeDayNight.NoActionBar" parent="AppThemeDayNight">
@@ -102,5 +100,10 @@
<item name="android:fontFamily">@font/lato_regular</item>
</style>
+ <style name="AppThemeIntro" parent="AppThemeDayNight.NoActionBar">
+ <item name="android:windowLightStatusBar">true</item>
+
+ </style>
+
</resources>
\ No newline at end of file
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 18, 07:29 (18 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2265350
Default Alt Text
D251.1794986998.diff (12 KB)
Attached To
Mode
D251: Fix status and navigation bar colors, fix open by intent
Attached
Detach File
Event Timeline