Page MenuHomeGitPull.it

D131.1773343799.diff
No OneTemporary

Size
19 KB
Referenced Files
None
Subscribers
None

D131.1773343799.diff

diff --git a/app/build.gradle b/app/build.gradle
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -54,7 +54,6 @@
dependencies {
//new libraries
-
}
}
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
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- >
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
@@ -13,18 +12,18 @@
<queries>
<intent>
- <action android:name="android.intent.action.VIEW" />
- <data android:scheme="http" />
+ <action android:name="android.intent.action.VIEW"/>
+ <data android:scheme="http"/>
</intent>
<intent>
- <action android:name="android.intent.action.VIEW" />
- <data android:scheme="https" />
+ <action android:name="android.intent.action.VIEW"/>
+ <data android:scheme="https"/>
</intent>
<intent>
- <action android:name="com.google.zxing.client.android.SCAN" />
+ <action android:name="com.google.zxing.client.android.SCAN"/>
</intent>
<intent>
- <action android:name="com.google.zxing.client.android.ENCODE" />
+ <action android:name="com.google.zxing.client.android.ENCODE"/>
</intent>
</queries>
@@ -36,7 +35,6 @@
android:networkSecurityConfig="@xml/networks_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme.NoActionBar">
-
<activity
android:name=".ActivityExperiments"
android:label="@string/experiments"
@@ -44,10 +42,10 @@
</activity>
<activity
android:name=".ActivityPrincipal"
+ android:exported="true"
android:label="@string/app_name"
android:screenOrientation="portrait"
- android:windowSoftInputMode="adjustResize"
- android:exported="true">
+ android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
@@ -105,7 +103,6 @@
android:enabled="true"
android:exported="false">
</provider>
-
<!-- Don't show the additional frame on samsung phones -->
<meta-data
android:name="com.samsung.android.icon_container.has_icon_container"
diff --git a/app/src/main/java/it/reyboz/bustorino/fragments/ArrivalsFragment.java b/app/src/main/java/it/reyboz/bustorino/fragments/ArrivalsFragment.java
--- a/app/src/main/java/it/reyboz/bustorino/fragments/ArrivalsFragment.java
+++ b/app/src/main/java/it/reyboz/bustorino/fragments/ArrivalsFragment.java
@@ -65,8 +65,11 @@
import it.reyboz.bustorino.util.LinesNameSorter;
import it.reyboz.bustorino.util.ViewUtils;
+import static it.reyboz.bustorino.fragments.ScreenBaseFragment.setOption;
+
public class ArrivalsFragment extends ResultBaseFragment implements LoaderManager.LoaderCallbacks<Cursor> {
+ private static final String OPTION_SHOW_LEGEND = "show_legend";
private final static String KEY_STOP_ID = "stopid";
private final static String KEY_STOP_NAME = "stopname";
private final static String DEBUG_TAG_ALL = "BUSTOArrivalsFragment";
@@ -92,6 +95,9 @@
protected RecyclerView arrivalsRecyclerView;
private PalinaAdapter mListAdapter = null;
+ private TextView howDoesItWorkTextView;
+ private Button hideHintButton;
+
//private NestedScrollView theScrollView;
protected RecyclerView noArrivalsRecyclerView;
@@ -181,6 +187,11 @@
View root = inflater.inflate(R.layout.fragment_arrivals, container, false);
messageTextView = root.findViewById(R.id.messageTextView);
addToFavorites = root.findViewById(R.id.addToFavorites);
+ // "How does it work part"
+ howDoesItWorkTextView = root.findViewById(R.id.howDoesItWorkTextView);
+ hideHintButton = root.findViewById(R.id.hideHintButton);
+ hideHintButton.setOnClickListener(this::onHideHint);
+
//theScrollView = root.findViewById(R.id.arrivalsScrollView);
// recyclerview holding the arrival times
arrivalsRecyclerView = root.findViewById(R.id.arrivalsRecyclerView);
@@ -288,6 +299,10 @@
updateMessage();
}
+ if (ScreenBaseFragment.getOption(requireContext(),OPTION_SHOW_LEGEND, true)) {
+ showHints();
+ }
+
}
@@ -333,6 +348,23 @@
this.reloadOnResume = reloadOnResume;
}
+ // HINT "HOW TO USE"
+ private void showHints() {
+ howDoesItWorkTextView.setVisibility(View.VISIBLE);
+ hideHintButton.setVisibility(View.VISIBLE);
+ //actionHelpMenuItem.setVisible(false);
+ }
+
+ private void hideHints() {
+ howDoesItWorkTextView.setVisibility(View.GONE);
+ hideHintButton.setVisibility(View.GONE);
+ //actionHelpMenuItem.setVisible(true);
+ }
+
+ public void onHideHint(View v) {
+ hideHints();
+ setOption(requireContext(),OPTION_SHOW_LEGEND, false);
+ }
/**
* Give the fetchers
* @return the list of the fetchers
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
@@ -68,7 +68,6 @@
public class MainScreenFragment extends ScreenBaseFragment implements FragmentListenerMain{
- private static final String OPTION_SHOW_LEGEND = "show_legend";
private static final String SAVED_FRAGMENT="saved_fragment";
private static final String DEBUG_TAG = "BusTO - MainFragment";
@@ -82,8 +81,7 @@
private EditText busStopSearchByIDEditText;
private EditText busStopSearchByNameEditText;
private ProgressBar progressBar;
- private TextView howDoesItWorkTextView;
- private Button hideHintButton;
+
private MenuItem actionHelpMenuItem;
private FloatingActionButton floatingActionButton;
private FrameLayout resultFrameLayout;
@@ -279,8 +277,7 @@
busStopSearchByIDEditText = root.findViewById(R.id.busStopSearchByIDEditText);
busStopSearchByNameEditText = root.findViewById(R.id.busStopSearchByNameEditText);
progressBar = root.findViewById(R.id.progressBar);
- howDoesItWorkTextView = root.findViewById(R.id.howDoesItWorkTextView);
- hideHintButton = root.findViewById(R.id.hideHintButton);
+
swipeRefreshLayout = root.findViewById(R.id.listRefreshLayout);
floatingActionButton = root.findViewById(R.id.floatingActionButton);
resultFrameLayout = root.findViewById(R.id.resultFrame);
@@ -311,7 +308,6 @@
coordLayout = root.findViewById(R.id.coord_layout);
floatingActionButton.setOnClickListener((this::onToggleKeyboardLayout));
- hideHintButton.setOnClickListener(this::onHideHint);
AppCompatImageButton qrButton = root.findViewById(R.id.QRButton);
qrButton.setOnClickListener(this::onQRButtonClick);
@@ -527,11 +523,7 @@
barcodeLauncher.launch(scanOptions);
}
}
- public void onHideHint(View v) {
- hideHints();
- setOption(OPTION_SHOW_LEGEND, false);
- }
/**
* OK this is pure shit
*
@@ -618,18 +610,6 @@
busStopSearchByIDEditText.setSelection(busStopID.length());
}
- private void showHints() {
- howDoesItWorkTextView.setVisibility(View.VISIBLE);
- hideHintButton.setVisibility(View.VISIBLE);
- //actionHelpMenuItem.setVisible(false);
- }
-
- private void hideHints() {
- howDoesItWorkTextView.setVisibility(View.GONE);
- hideHintButton.setVisibility(View.GONE);
- //actionHelpMenuItem.setVisible(true);
- }
-
@Nullable
@org.jetbrains.annotations.Nullable
@Override
@@ -711,9 +691,6 @@
switch (fragmentType) {
case ARRIVALS:
prepareGUIForBusLines();
- if (getOption(OPTION_SHOW_LEGEND, true)) {
- showHints();
- }
break;
case STOPS:
prepareGUIForBusStops();
diff --git a/app/src/main/java/it/reyboz/bustorino/fragments/ScreenBaseFragment.java b/app/src/main/java/it/reyboz/bustorino/fragments/ScreenBaseFragment.java
--- a/app/src/main/java/it/reyboz/bustorino/fragments/ScreenBaseFragment.java
+++ b/app/src/main/java/it/reyboz/bustorino/fragments/ScreenBaseFragment.java
@@ -16,7 +16,7 @@
public abstract class ScreenBaseFragment extends Fragment {
- protected final String PREF_FILE= BuildConfig.APPLICATION_ID+".fragment_prefs";
+ protected final static String PREF_FILE= BuildConfig.APPLICATION_ID+".fragment_prefs";
protected void setOption(String optionName, boolean value) {
Context mContext = getContext();
@@ -27,8 +27,8 @@
protected boolean getOption(String optionName, boolean optDefault) {
Context mContext = getContext();
- SharedPreferences preferences = mContext.getSharedPreferences(PREF_FILE, MODE_PRIVATE);
- return preferences.getBoolean(optionName, optDefault);
+ assert mContext != null;
+ return getOption(mContext, optionName, optDefault);
}
protected void showToastMessage(int messageID, boolean short_lenght) {
@@ -52,4 +52,14 @@
*/
@Nullable
public abstract View getBaseViewForSnackBar();
+
+ public static boolean getOption(Context context, String optionName, boolean optDefault){
+ SharedPreferences preferences = context.getSharedPreferences(PREF_FILE, MODE_PRIVATE);
+ return preferences.getBoolean(optionName, optDefault);
+ }
+ public static void setOption(Context context,String optionName, boolean value) {
+ SharedPreferences.Editor editor = context.getSharedPreferences(PREF_FILE, MODE_PRIVATE).edit();
+ editor.putBoolean(optionName, value);
+ editor.apply();
+ }
}
diff --git a/app/src/main/res/drawable/top_bottom_border_radius.xml b/app/src/main/res/drawable/top_bottom_border_radius.xml
new file mode 100644
--- /dev/null
+++ b/app/src/main/res/drawable/top_bottom_border_radius.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <solid android:color="@color/black" />
+ <corners
+ android:bottomLeftRadius="10dp"
+ android:bottomRightRadius="10dp"
+ android:topLeftRadius="10dp"
+ android:topRightRadius="10dp" />
+</shape>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/top_bottom_border_radius_with_border.xml b/app/src/main/res/drawable/top_bottom_border_radius_with_border.xml
new file mode 100644
--- /dev/null
+++ b/app/src/main/res/drawable/top_bottom_border_radius_with_border.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <solid android:color="@color/black" />
+ <stroke
+ android:width="2dip"
+ android:color="@color/black_900" />
+ <corners
+ android:bottomLeftRadius="10dp"
+ android:bottomRightRadius="10dp"
+ android:topLeftRadius="10dp"
+ android:topRightRadius="10dp" />
+</shape>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_arrivals.xml b/app/src/main/res/layout/fragment_arrivals.xml
--- a/app/src/main/res/layout/fragment_arrivals.xml
+++ b/app/src/main/res/layout/fragment_arrivals.xml
@@ -5,7 +5,41 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:paddingTop="8dp">
+ android:paddingTop="8dp"
+ android:animateLayoutChanges="true">
+ <TextView
+ android:id="@+id/howDoesItWorkTextView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="16dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginLeft="16dip"
+ android:layout_marginRight="16dp"
+ android:layout_marginStart="16dip"
+ android:layout_marginTop="10dp"
+ android:layout_toLeftOf="@+id/hideHintButton"
+ android:layout_toStartOf="@+id/hideHintButton"
+ android:text="@string/howDoesItWork"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="@color/blue_500"
+ android:visibility="gone" android:layout_alignParentTop="true"/>
+
+ <Button
+ android:id="@+id/hideHintButton"
+ style="?android:attr/buttonStyleSmall"
+ android:layout_width="85dip"
+ android:layout_height="wrap_content"
+ android:layout_alignBottom="@+id/howDoesItWorkTextView"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentRight="true"
+ android:layout_marginEnd="16dp"
+ android:layout_marginRight="16dp"
+ android:layout_marginBottom="5dp"
+ android:background="@drawable/route_background_bus"
+ android:text="@string/hint_button"
+ android:textColor="@color/grey_100"
+ android:textSize="19sp"
+ android:visibility="gone" />
<androidx.cardview.widget.CardView
android:id="@+id/messageCardView"
@@ -13,6 +47,9 @@
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="2dp"
+ android:layout_below="@id/howDoesItWorkTextView"
+ android:layout_marginStart="5dp"
+ android:layout_marginEnd="5dp"
>
<TextView
diff --git a/app/src/main/res/layout/fragment_lines_detail.xml b/app/src/main/res/layout/fragment_lines_detail.xml
--- a/app/src/main/res/layout/fragment_lines_detail.xml
+++ b/app/src/main/res/layout/fragment_lines_detail.xml
@@ -34,7 +34,7 @@
android:id="@+id/routeDescrTextView"
app:layout_constraintStart_toStartOf="parent"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
- android:textColor="@color/grey_600"
+ android:textColor="?android:attr/textColorPrimary"
android:gravity="center_vertical"
android:textSize="18sp"
android:layout_marginLeft="10dp"
diff --git a/app/src/main/res/layout/fragment_main_screen.xml b/app/src/main/res/layout/fragment_main_screen.xml
--- a/app/src/main/res/layout/fragment_main_screen.xml
+++ b/app/src/main/res/layout/fragment_main_screen.xml
@@ -97,38 +97,7 @@
android:indeterminateOnly="true"
android:visibility="gone" />
- <TextView
- android:id="@+id/howDoesItWorkTextView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="5dp"
- android:layout_marginEnd="16dp"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dp"
- android:layout_marginStart="16dip"
- android:layout_marginTop="10dp"
- android:layout_toLeftOf="@+id/hideHintButton"
- android:layout_toStartOf="@+id/hideHintButton"
- android:text="@string/howDoesItWork"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/blue_500"
- android:visibility="gone" android:layout_below="@+id/searchButton"/>
- <Button
- android:id="@+id/hideHintButton"
- style="?android:attr/buttonStyleSmall"
- android:layout_width="85dip"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@+id/howDoesItWorkTextView"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_marginEnd="16dp"
- android:layout_marginRight="16dp"
- android:background="@drawable/route_background_bus"
- android:text="@string/hint_button"
- android:textColor="@color/grey_100"
- android:textSize="19sp"
- android:visibility="gone" />
<androidx.coordinatorlayout.widget.CoordinatorLayout
@@ -139,7 +108,7 @@
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="bottom|end"
- android:layout_below="@+id/howDoesItWorkTextView"
+ android:layout_below="@+id/searchButton"
>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -3,7 +3,7 @@
<color name="orange_500">#ff9800</color>
<color name="orange_700">#F57C00</color>
- <color name="orange_700_40light"> #cc6600</color>
+ <color name="orange_700_40light">#cc6600</color>
<color name="orange_700_30light">#994d00</color>
<color name="blue_500">#2196F3</color>
<color name="blue_620">#2a65e8</color>
@@ -43,5 +43,13 @@
<color name="line_drawn_poly">@color/red_dark</color>
<color name="bus_marker_color">@color/blue_extra</color>
+ <color name="light_blue_600">#FF039BE5</color>
+ <color name="light_blue_900">#FF01579B</color>
+ <color name="light_blue_A200">#FF40C4FF</color>
+ <color name="light_blue_A400">#FF00B0FF</color>
+ <color name="black_overlay">#66000000</color>
+
+
+ <color name="colorTransparent">#00000000</color>
</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
@@ -51,5 +51,25 @@
<item name="editTextPreferenceStyle">@style/Preference.DialogPreference.EditTextPreference</item>
<item name="preferenceFragmentListStyle">@style/PreferenceFragmentList</item>
</style>
+ <style name="Widget.AppTheme.NoActionBar.ActionBar.Fullscreen" parent="Widget.AppCompat.ActionBar">
+ <item name="android:background">@color/black_overlay</item>
+ </style>
+
+ <style name="Widget.AppTheme.NoActionBar.ButtonBar.Fullscreen" parent="">
+ <item name="android:background">@color/black_overlay</item>
+ <item name="android:buttonBarStyle">?android:attr/buttonBarStyle</item>
+ </style>
+
+ <!-- styles that support night mode -->
+ <style name="AppThemeDayNight" parent="Theme.MaterialComponents.DayNight">
+ </style>
+
+ <style name="AppThemeDayNight.NoActionBar" parent="AppThemeDayNight">
+
+ <item name="android:windowTranslucentStatus">false</item>
+
+ <item name="windowActionBar">false</item>
+ <item name="windowNoTitle">true</item>
+ </style>
</resources>
\ No newline at end of file

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 12, 20:29 (20 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1740717
Default Alt Text
D131.1773343799.diff (19 KB)

Event Timeline