issue fix

This commit is contained in:
simon 2020-11-13 16:54:10 +02:00
parent ce648cb1db
commit ad391971ec
5 changed files with 40 additions and 27 deletions

View file

@ -10,11 +10,11 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_marginTop="24dp">
android:layout_marginTop="@dimen/dialog_content_margin">
<ImageView
android:id="@+id/back_button"
style="@style/Widget.AppCompat.Toolbar.Button.Navigation"
android:paddingLeft="@dimen/content_padding"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
@ -36,14 +36,14 @@
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginLeft="@dimen/content_padding"
android:textColor="@color/color_black"
android:textSize="20sp"
android:lineSpacingExtra="5sp"
android:textAlignment="center"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="6dp"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/content_padding"
android:layout_marginBottom="@dimen/dashPadding"
android:text="@string/register_on_openplacereviews"
android:gravity="center_horizontal"/>
@ -52,38 +52,38 @@
android:id="@+id/start_opr_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="@dimen/dashPadding"
android:layout_marginLeft="@dimen/content_padding"
android:lineSpacingExtra="5sp"
android:textColor="@color/color_black"
android:textColorLink="@color/icon_color_active_light"
android:layout_marginRight="16dp"
android:layout_marginRight="@dimen/content_padding"
android:text="@string/register_on_openplacereviews_desc"/>
<LinearLayout
android:gravity="bottom"
android:orientation="vertical"
android:layout_marginBottom="12dp"
android:layout_marginBottom="@dimen/content_padding_small"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/register_opr_create_account"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="6dp"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginBottom="@dimen/dashPadding"
android:text="@string/register_opr_create_new_account"
android:textColor="@color/color_white"
android:layout_marginTop="12dp"
android:layout_marginTop="@dimen/content_padding_small"
android:background="@color/icon_color_active_light"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/register_opr_have_account"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="6dp"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginTop="@dimen/dashPadding"
android:layout_gravity="bottom"
android:text="@string/register_opr_have_account"
android:textColor="@color/icon_color_active_light"

View file

@ -23,7 +23,6 @@
<string name="enter_text_separated">Enter tags separated by comma.</string>
<string name="send_files_to_openstreetmap">Send GPX file to OpenStreetMap</string>
<string name="markers_history">Markers history</string>
>>>>>>> fd85ed7c4201db81b3fbbea71aebfb0155066129
<string name="subscription_on_hold_title">OsmAnd Live subscription is on hold</string>
<string name="subscription_paused_title">OsmAnd Live subscription has been paused</string>
<string name="subscription_expired_title">OsmAnd Live subscription has been expired</string>

View file

@ -316,9 +316,7 @@ public class MenuBuilder {
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
mapActivity.getSupportFragmentManager().beginTransaction()
.add(R.id.fragmentContainer, new OprStartFragment(), "OPR_REGISTER_FRAGMENT")
.addToBackStack(null).commit();
OprStartFragment.showInstance(mapActivity.getSupportFragmentManager());
}
});
b.setTypeface(FontCache.getRobotoRegular(context));

View file

@ -10,22 +10,20 @@ import android.webkit.WebViewClient;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import net.osmand.PlatformUtil;
import net.osmand.AndroidUtils;
import net.osmand.plus.BuildConfig;
import net.osmand.plus.R;
import net.osmand.plus.activities.OsmandActionBarActivity;
import org.apache.commons.logging.Log;
public class OPRWebviewActivity extends OsmandActionBarActivity {
public static final String KEY_LOGIN = "LOGIN_KEY";
private WebView webView;
private static final String url = BuildConfig.OPR_BASE_URL;
private static final String cookieUrl = BuildConfig.OPR_BASE_URL + "profile";
private static final String loginUrl = BuildConfig.OPR_BASE_URL + "login";
private static final String registerUrl = BuildConfig.OPR_BASE_URL + "signup";
private static final String finishUrl = cookieUrl;
public static String KEY_TITLE = "TITLE_KEY";
private final Log log = PlatformUtil.getLog(OPRWebviewActivity.class);
private WebView webView;
private boolean isLogin = false;
public void onCreate(Bundle savedInstanceState) {
@ -38,7 +36,7 @@ public class OPRWebviewActivity extends OsmandActionBarActivity {
this.<TextView>findViewById(R.id.toolbar_text).setText(title);
}
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
final Drawable upArrow = ContextCompat.getDrawable(this, R.drawable.ic_arrow_back);
final Drawable upArrow = getMyApplication().getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(this));
upArrow.setColorFilter(ContextCompat.getColor(this, R.color.color_favorite_gray), PorterDuff.Mode.SRC_ATOP);
getSupportActionBar().setHomeAsUpIndicator(upArrow);
webView = (WebView) findViewById(R.id.printDialogWebview);

View file

@ -13,11 +13,16 @@ import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;
import net.osmand.PlatformUtil;
import net.osmand.plus.R;
import net.osmand.plus.base.BaseOsmAndFragment;
import org.apache.commons.logging.Log;
public class OprStartFragment extends BaseOsmAndFragment {
private static String openPlaceReviewsUrl = "OpenPlaceReviews.org";
private static final String TAG = "fragment_oprstart";
private static final Log LOG = PlatformUtil.getLog(OprStartFragment.class);
private static final String openPlaceReviewsUrl = "OpenPlaceReviews.org";
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@ -72,4 +77,17 @@ public class OprStartFragment extends BaseOsmAndFragment {
}
}
public static void showInstance(@NonNull FragmentManager fm) {
try {
if (fm.findFragmentByTag(OprStartFragment.TAG) == null) {
OprStartFragment fragment = new OprStartFragment();
fm.beginTransaction()
.add(R.id.fragmentContainer, fragment, OprStartFragment.TAG)
.addToBackStack(null).commit();
}
} catch (RuntimeException e) {
LOG.error("showInstance", e);
}
}
}