Hide support region setting
This commit is contained in:
parent
2d2a951dde
commit
cf26ccc7ab
2 changed files with 83 additions and 83 deletions
|
@ -21,69 +21,69 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/support_region_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:paddingStart="@dimen/content_padding"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:paddingEnd="@dimen/content_padding">
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/support_region_container"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- android:background="?android:attr/selectableItemBackground"-->
|
||||
<!-- android:paddingStart="@dimen/content_padding"-->
|
||||
<!-- android:paddingLeft="@dimen/content_padding"-->
|
||||
<!-- android:paddingRight="@dimen/content_padding"-->
|
||||
<!-- android:paddingEnd="@dimen/content_padding">-->
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/setting_list_item_group_height"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/map_widget_height"
|
||||
android:layout_marginRight="@dimen/map_widget_height"
|
||||
app:srcCompat="@drawable/ic_world_globe_dark"
|
||||
app:tint="?attr/default_icon_color" />
|
||||
<!-- <androidx.appcompat.widget.AppCompatImageView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:minHeight="@dimen/setting_list_item_group_height"-->
|
||||
<!-- android:layout_gravity="center_vertical"-->
|
||||
<!-- android:layout_marginEnd="@dimen/map_widget_height"-->
|
||||
<!-- android:layout_marginRight="@dimen/map_widget_height"-->
|
||||
<!-- app:srcCompat="@drawable/ic_world_globe_dark"-->
|
||||
<!-- app:tint="?attr/default_icon_color" />-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="@dimen/content_padding_small"
|
||||
android:layout_marginBottom="@dimen/content_padding_small"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:layout_marginTop="@dimen/content_padding_small"-->
|
||||
<!-- android:layout_marginBottom="@dimen/content_padding_small"-->
|
||||
<!-- android:layout_gravity="center_vertical"-->
|
||||
<!-- android:orientation="vertical">-->
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/support_region_header"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
tools:text="@string/osm_live_support_region"/>
|
||||
<!-- <net.osmand.plus.widgets.TextViewEx-->
|
||||
<!-- android:id="@+id/support_region_header"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:textColor="?android:attr/textColorPrimary"-->
|
||||
<!-- android:textSize="@dimen/default_list_text_size"-->
|
||||
<!-- osmand:typeface="@string/font_roboto_regular"-->
|
||||
<!-- tools:text="@string/osm_live_support_region"/>-->
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/support_region"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:text="@string/osm_live_support_region"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
tools:text="@string/clear_updates_proposition_message"/>
|
||||
<!-- <net.osmand.plus.widgets.TextViewEx-->
|
||||
<!-- android:id="@+id/support_region"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginEnd="@dimen/content_padding"-->
|
||||
<!-- android:layout_marginRight="@dimen/content_padding"-->
|
||||
<!-- android:text="@string/osm_live_support_region"-->
|
||||
<!-- android:textColor="?android:attr/textColorSecondary"-->
|
||||
<!-- android:textSize="@dimen/default_desc_text_size"-->
|
||||
<!-- osmand:typeface="@string/font_roboto_regular"-->
|
||||
<!-- tools:text="@string/clear_updates_proposition_message"/>-->
|
||||
|
||||
</LinearLayout>
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:srcCompat="@drawable/ic_action_settings"
|
||||
app:tint="?attr/default_icon_color" />
|
||||
<!-- <androidx.appcompat.widget.AppCompatImageView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="center_vertical"-->
|
||||
<!-- app:srcCompat="@drawable/ic_action_settings"-->
|
||||
<!-- app:tint="?attr/default_icon_color" />-->
|
||||
|
||||
</LinearLayout>
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<include layout="@layout/simple_divider_item" />
|
||||
<!-- <include layout="@layout/simple_divider_item" />-->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/report_container"
|
||||
|
|
|
@ -28,7 +28,7 @@ public class SubscriptionsCard extends BaseCard {
|
|||
private static final String PLAY_STORE_SUBSCRIPTION_DEEPLINK_URL = "https://play.google.com/store/account/subscriptions?sku=%s&package=%s";
|
||||
|
||||
private Fragment target;
|
||||
private CountrySelectionFragment countrySelectionFragment = new CountrySelectionFragment();
|
||||
// private CountrySelectionFragment countrySelectionFragment = new CountrySelectionFragment();
|
||||
private SubscriptionsListCard subscriptionsListCard;
|
||||
|
||||
private InAppPurchaseHelper purchaseHelper;
|
||||
|
@ -100,23 +100,23 @@ public class SubscriptionsCard extends BaseCard {
|
|||
}
|
||||
|
||||
private void setupSupportRegion() {
|
||||
String region = LiveUpdatesFragment.getSupportRegionName(app, purchaseHelper);
|
||||
String header = LiveUpdatesFragment.getSupportRegionHeader(app, region);
|
||||
TextView supportRegionHeader = view.findViewById(R.id.support_region_header);
|
||||
TextView supportRegion = view.findViewById(R.id.support_region);
|
||||
supportRegionHeader.setText(header);
|
||||
supportRegion.setText(region);
|
||||
|
||||
View supportRegionContainer = view.findViewById(R.id.support_region_container);
|
||||
supportRegionContainer.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
CountrySelectionFragment countryCountrySelectionFragment = countrySelectionFragment;
|
||||
countryCountrySelectionFragment.show(target.getChildFragmentManager(), CountrySelectionFragment.TAG);
|
||||
}
|
||||
});
|
||||
|
||||
countrySelectionFragment.initCountries(app);
|
||||
// String region = LiveUpdatesFragment.getSupportRegionName(app, purchaseHelper);
|
||||
// String header = LiveUpdatesFragment.getSupportRegionHeader(app, region);
|
||||
// TextView supportRegionHeader = view.findViewById(R.id.support_region_header);
|
||||
// TextView supportRegion = view.findViewById(R.id.support_region);
|
||||
// supportRegionHeader.setText(header);
|
||||
// supportRegion.setText(region);
|
||||
//
|
||||
// View supportRegionContainer = view.findViewById(R.id.support_region_container);
|
||||
// supportRegionContainer.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// CountrySelectionFragment countryCountrySelectionFragment = countrySelectionFragment;
|
||||
// countryCountrySelectionFragment.show(target.getChildFragmentManager(), CountrySelectionFragment.TAG);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// countrySelectionFragment.initCountries(app);
|
||||
}
|
||||
|
||||
private String getSubscriptionUrl() {
|
||||
|
@ -131,15 +131,15 @@ public class SubscriptionsCard extends BaseCard {
|
|||
}
|
||||
|
||||
public void onSupportRegionSelected(CountrySelectionFragment.CountryItem selectedCountryItem) {
|
||||
String countryName = selectedCountryItem != null ? selectedCountryItem.getLocalName() : "";
|
||||
String countryDownloadName = selectedCountryItem != null ?
|
||||
selectedCountryItem.getDownloadName() : OsmandSettings.BILLING_USER_DONATION_WORLD_PARAMETER;
|
||||
|
||||
TextView supportRegionHeader = view.findViewById(R.id.support_region_header);
|
||||
TextView supportRegion = view.findViewById(R.id.support_region);
|
||||
supportRegionHeader.setText(LiveUpdatesFragment.getSupportRegionHeader(app, countryName));
|
||||
supportRegion.setText(countryName);
|
||||
app.getSettings().BILLING_USER_COUNTRY.set(countryName);
|
||||
app.getSettings().BILLING_USER_COUNTRY_DOWNLOAD_NAME.set(countryDownloadName);
|
||||
// String countryName = selectedCountryItem != null ? selectedCountryItem.getLocalName() : "";
|
||||
// String countryDownloadName = selectedCountryItem != null ?
|
||||
// selectedCountryItem.getDownloadName() : OsmandSettings.BILLING_USER_DONATION_WORLD_PARAMETER;
|
||||
//
|
||||
// TextView supportRegionHeader = view.findViewById(R.id.support_region_header);
|
||||
// TextView supportRegion = view.findViewById(R.id.support_region);
|
||||
// supportRegionHeader.setText(LiveUpdatesFragment.getSupportRegionHeader(app, countryName));
|
||||
// supportRegion.setText(countryName);
|
||||
// app.getSettings().BILLING_USER_COUNTRY.set(countryName);
|
||||
// app.getSettings().BILLING_USER_COUNTRY_DOWNLOAD_NAME.set(countryDownloadName);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue