remove unnecessary ui elements from the map, other small stuff

This commit is contained in:
Emin 2024-06-06 16:16:47 +05:00
parent 7326924a23
commit ba0f2bb041
16 changed files with 42 additions and 92 deletions

View file

@ -333,7 +333,7 @@
</activity>
<activity
android:name="app.MainActivity"
android:name="app.tourism.MainActivity"
android:exported="false"
android:label="@string/title_activity_main"
android:theme="@style/MwmTheme" />

View file

@ -16,7 +16,7 @@ import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AppCompatActivity;
import app.MainActivity;
import app.tourism.MainActivity;
import app.organicmaps.display.DisplayManager;
import app.organicmaps.location.LocationHelper;
import app.organicmaps.util.Config;

View file

@ -99,8 +99,6 @@ public class MapButtonsController extends Fragment
.setOnClickListener((v) -> mMapButtonClickListener.onMapButtonClick(MapButtons.zoomIn));
mFrame.findViewById(R.id.nav_zoom_out)
.setOnClickListener((v) -> mMapButtonClickListener.onMapButtonClick(MapButtons.zoomOut));
final View bookmarksButton = mFrame.findViewById(R.id.btn_bookmarks);
bookmarksButton.setOnClickListener((v) -> mMapButtonClickListener.onMapButtonClick(MapButtons.bookmarks));
final View myPosition = mFrame.findViewById(R.id.my_position);
mNavMyPosition = new MyPositionButton(myPosition, (v) -> mMapButtonClickListener.onMapButtonClick(MapButtons.myPosition));
@ -140,7 +138,6 @@ public class MapButtonsController extends Fragment
mButtonsMap = new HashMap<>();
mButtonsMap.put(MapButtons.zoom, zoomFrame);
mButtonsMap.put(MapButtons.myPosition, myPosition);
mButtonsMap.put(MapButtons.bookmarks, bookmarksButton);
mButtonsMap.put(MapButtons.search, searchButton);
if (mToggleMapLayerButton != null)

View file

@ -527,18 +527,10 @@ public class PlacePageController extends Fragment implements
// And move the bookmark button at the end
if (needToShowRoutingButtons && RoutingController.get().isStopPointAllowed())
buttons.add(PlacePageButtons.ButtonType.ROUTE_ADD);
else
buttons.add(mapObject.isBookmark()
? PlacePageButtons.ButtonType.BOOKMARK_DELETE
: PlacePageButtons.ButtonType.BOOKMARK_SAVE);
if (needToShowRoutingButtons)
{
buttons.add(PlacePageButtons.ButtonType.ROUTE_TO);
if (RoutingController.get().isStopPointAllowed())
buttons.add(mapObject.isBookmark()
? PlacePageButtons.ButtonType.BOOKMARK_DELETE
: PlacePageButtons.ButtonType.BOOKMARK_SAVE);
}
}
mViewModel.setCurrentButtons(buttons);

View file

@ -423,19 +423,6 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
// showTaxiOffer(mapObject);
if (RoutingController.get().isNavigating() || RoutingController.get().isPlanning())
{
UiUtils.hide(mEditPlace, mAddOrganisation, mAddPlace, mEditTopSpace);
}
else
{
UiUtils.showIf(Editor.nativeShouldShowEditPlace(), mEditPlace);
UiUtils.showIf(Editor.nativeShouldShowAddBusiness(), mAddOrganisation);
UiUtils.showIf(Editor.nativeShouldShowAddPlace(), mAddPlace);
UiUtils.showIf(UiUtils.isVisible(mEditPlace)
|| UiUtils.isVisible(mAddOrganisation)
|| UiUtils.isVisible(mAddPlace), mEditTopSpace);
}
updateLinksView();
updateOpeningHoursView();
updateWikipediaView();

View file

@ -1,4 +1,4 @@
package app
package app.tourism
import android.content.Intent
import android.os.Bundle
@ -16,8 +16,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import androidx.core.content.ContextCompat.startActivity
import app.organicmaps.MwmActivity
import app.ui.theme.OrganicMapsTheme
import app.organicmaps.DownloadResourcesLegacyActivity
import app.tourism.ui.theme.OrganicMapsTheme
class MainActivity : ComponentActivity() {
@ -47,7 +47,7 @@ fun Greeting(name: String, modifier: Modifier = Modifier) {
)
Button(
onClick = {
val intent = Intent(context, MwmActivity::class.java)
val intent = Intent(context, DownloadResourcesLegacyActivity::class.java)
startActivity(context, intent, null)
},
) {

View file

@ -1,4 +1,4 @@
package app.ui.theme
package app.tourism.ui.theme
import androidx.compose.ui.graphics.Color

View file

@ -1,6 +1,5 @@
package app.ui.theme
package app.tourism.ui.theme
import android.app.Activity
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme

View file

@ -1,4 +1,4 @@
package app.ui.theme
package app.tourism.ui.theme
import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle

View file

@ -14,7 +14,7 @@
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible" />
<androidx.constraintlayout.widget.ConstraintLayout
<RelativeLayout
android:id="@+id/map_buttons_inner_left"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@ -25,30 +25,17 @@
android:padding="@dimen/nav_frame_padding"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent">
<include
layout="@layout/map_buttons_bookmarks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<include
layout="@layout/map_buttons_search_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="@+id/btn_search"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/btn_search" />
android:layout_centerInParent="true"/>
<include
layout="@layout/map_buttons_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/margin_half"
app:layout_constraintBottom_toTopOf="@+id/btn_bookmarks"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_centerVertical="true"/>
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/map_buttons_inner_right"
android:layout_width="wrap_content"

View file

@ -18,21 +18,13 @@
android:clipToPadding="false"
android:padding="@dimen/nav_frame_padding"
app:layout_constraintStart_toStartOf="parent">
<include
layout="@layout/map_buttons_bookmarks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<include
layout="@layout/map_buttons_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/margin_half"
app:layout_constraintBottom_toTopOf="@+id/btn_bookmarks"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout

View file

@ -59,6 +59,7 @@
android:layout_weight="0.2"
android:background="?selectableItemBackgroundBorderless"
android:scaleType="center"
android:visibility="gone"
app:srcCompat="@drawable/ic_menu_settings"
app:tint="?iconTint" />

View file

@ -25,14 +25,6 @@
android:padding="@dimen/nav_frame_padding"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent">
<include
layout="@layout/map_buttons_bookmarks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/margin_half"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/btn_search" />
<include
layout="@layout/map_buttons_search_frame"
android:layout_width="wrap_content"

View file

@ -19,22 +19,14 @@
android:padding="@dimen/nav_frame_padding"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent">
<include
layout="@layout/map_buttons_bookmarks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<include
layout="@layout/map_buttons_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/margin_half"
app:layout_constraintBottom_toTopOf="@+id/btn_bookmarks"
app:layout_constraintStart_toStartOf="parent" />
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/map_buttons_inner_right"

View file

@ -19,6 +19,7 @@
android:id="@+id/place_page_bookmark_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
tools:layout="@layout/place_page_bookmark_fragment" />
<androidx.fragment.app.FragmentContainerView
@ -53,6 +54,7 @@
android:id="@+id/place_page_links_fragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
tools:layout="@layout/place_page_links_fragment" />
<include layout="@layout/place_page_level" />

View file

@ -1,15 +1,24 @@
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
# org.gradle.parallel=true
#Thu Jun 06 15:38:47 TJT 2024
android.native.buildOutput=verbose
android.nonFinalResIds=false
android.nonTransitiveRClass=true
android.useAndroidX=true
enableVulkanDiagnostics=OFF
org.gradle.caching=true
org.gradle.jvmargs=-Xmx1536M -Dkotlin.daemon.jvm.options\="-Xmx1024M" -Xms256m
propCompileSdkVersion=34
propMinSdkVersion=21
propTargetSdkVersion=34
propCompileSdkVersion=34
org.gradle.caching=true
org.gradle.jvmargs=-Xmx1024m -Xms256m
android.useAndroidX=true
android.native.buildOutput=verbose
android.nonTransitiveRClass=true
android.nonFinalResIds=false
enableVulkanDiagnostics=OFF
# Autogenerated by tools/unix/generate_localizations.sh
supportedLocalizations=af,ar,az,be,bg,ca,cs,da,de,el,en,en_GB,es,es_MX,et,eu,fa,fi,fr,fr_CA,iw,hi,hu,in,it,ja,ko,lt,mr,nb,nl,pl,pt,pt_BR,ro,ru,sk,sv,sw,th,tr,uk,vi,zh,zh_HK,zh_MO,zh_TW