[android] Review notes - changed layout xml, changed auth frag api, updated globe and link icons, changed method qualifier
BIN
android/res/drawable-hdpi/ic_globe.png
Executable file → Normal file
Before Width: | Height: | Size: 969 B After Width: | Height: | Size: 864 B |
BIN
android/res/drawable-hdpi/ic_link.png
Executable file → Normal file
Before Width: | Height: | Size: 827 B After Width: | Height: | Size: 758 B |
BIN
android/res/drawable-mdpi/ic_globe.png
Executable file → Normal file
Before Width: | Height: | Size: 549 B After Width: | Height: | Size: 517 B |
BIN
android/res/drawable-mdpi/ic_link.png
Executable file → Normal file
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 480 B |
BIN
android/res/drawable-xhdpi/ic_globe.png
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
android/res/drawable-xhdpi/ic_link.png
Executable file → Normal file
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1,018 B |
BIN
android/res/drawable-xxhdpi/ic_globe.png
Executable file → Normal file
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
android/res/drawable-xxhdpi/ic_link.png
Executable file → Normal file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
android/res/drawable-xxxhdpi/ic_globe.png
Executable file → Normal file
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
android/res/drawable-xxxhdpi/ic_link.png
Executable file → Normal file
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.1 KiB |
|
@ -70,7 +70,7 @@
|
|||
<TextView
|
||||
android:id="@+id/upload_and_publish_text"
|
||||
android:text="@string/upload_and_publish"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:background="?selectableItemBackground"
|
||||
android:textColor="?colorAccent"
|
||||
android:textAllCaps="true"
|
||||
|
@ -79,12 +79,15 @@
|
|||
android:paddingEnd="@dimen/margin_base"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
tools:ignore="RtlSymmetry"/>
|
||||
<include
|
||||
android:visibility="gone"
|
||||
android:paddingRight="@dimen/margin_base"
|
||||
android:paddingEnd="@dimen/margin_base"
|
||||
android:id="@+id/upload_and_publish_progress_container"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_marginEnd="@dimen/margin_base"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
layout="@layout/ugc_routes_progress_container"/>
|
||||
<View
|
||||
android:background="?android:attr/listDivider"
|
||||
|
@ -93,8 +96,8 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/margin_base"
|
||||
android:paddingEnd="@dimen/margin_base"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_marginEnd="@dimen/margin_base"
|
||||
android:text="@string/upload_and_publish_desc"
|
||||
android:paddingTop="@dimen/margin_half_double_plus"
|
||||
android:paddingBottom="@dimen/margin_half_double_plus"/>
|
||||
|
@ -109,8 +112,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/margin_half_double_plus"
|
||||
android:paddingBottom="@dimen/margin_half_double_plus"
|
||||
android:paddingRight="@dimen/margin_base"
|
||||
android:paddingEnd="@dimen/margin_base"/>
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_marginEnd="@dimen/margin_base"/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
@ -168,18 +171,21 @@
|
|||
android:minHeight="@dimen/height_block_base"
|
||||
android:text="@string/upload_and_get_direct_link"
|
||||
android:background="?selectableItemBackground"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?colorAccent"
|
||||
android:textAllCaps="true"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="@dimen/margin_base"
|
||||
android:paddingEnd="@dimen/margin_base"/>
|
||||
android:paddingEnd="@dimen/margin_base"
|
||||
tools:ignore="RtlSymmetry"/>
|
||||
<include
|
||||
android:visibility="gone"
|
||||
android:paddingRight="@dimen/margin_base"
|
||||
android:paddingEnd="@dimen/margin_base"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_marginEnd="@dimen/margin_base"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/get_direct_link_progress_container"
|
||||
layout="@layout/ugc_routes_progress_container"/>
|
||||
<View
|
||||
|
@ -190,8 +196,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/get_direct_link_desc"
|
||||
android:paddingRight="@dimen/margin_base"
|
||||
android:paddingEnd="@dimen/margin_base"
|
||||
android:layout_marginRight="@dimen/margin_base"
|
||||
android:layout_marginEnd="@dimen/margin_base"
|
||||
android:paddingTop="@dimen/margin_half_double_plus"
|
||||
android:paddingBottom="@dimen/margin_half_double_plus"/>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:text="@string/upload_and_publish_progress_text"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textAllCaps="true"
|
||||
android:minHeight="@dimen/height_block_base"
|
||||
android:gravity="center_vertical"
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
package com.mapswithme.maps;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.text.Spannable;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class DisabledBrowserMovementMethod extends LinkMovementMethod
|
||||
{
|
||||
private DisabledBrowserMovementMethod()
|
||||
{
|
||||
}
|
||||
|
||||
public static DisabledBrowserMovementMethod getInstance()
|
||||
{
|
||||
return new DisabledBrowserMovementMethod();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event)
|
||||
{
|
||||
boolean result = true;
|
||||
try
|
||||
{
|
||||
result = super.onTouchEvent(widget, buffer, event);
|
||||
}
|
||||
catch (ActivityNotFoundException e)
|
||||
{
|
||||
/* FIXME */
|
||||
Toast.makeText(widget.getContext(), R.string.error_system_message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -51,9 +51,8 @@ public abstract class BaseMwmAuthorizationFragment extends BaseMwmToolbarFragmen
|
|||
return isAdded();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
protected Authorizer getAuthorizer()
|
||||
protected boolean isAuthorized()
|
||||
{
|
||||
return mAuthorizer;
|
||||
return mAuthorizer.isAuthorized();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ import com.mapswithme.maps.widget.ToolbarController;
|
|||
|
||||
public class BaseMwmToolbarFragment extends BaseMwmFragment
|
||||
{
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private ToolbarController mToolbarController;
|
||||
|
||||
@Override
|
||||
|
@ -17,13 +19,14 @@ public class BaseMwmToolbarFragment extends BaseMwmFragment
|
|||
mToolbarController = onCreateToolbarController(view);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
protected ToolbarController onCreateToolbarController(@NonNull View root)
|
||||
{
|
||||
return new ToolbarController(root, getActivity());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public ToolbarController getToolbarController()
|
||||
protected ToolbarController getToolbarController()
|
||||
{
|
||||
return mToolbarController;
|
||||
}
|
||||
|
|
|
@ -377,6 +377,7 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
|
|||
item.getLat(), item.getLon());
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected ToolbarController onCreateToolbarController(@NonNull View root)
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ public class AuthFragment extends BaseMwmToolbarFragment
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
getToolbarController().setTitle(R.string.thank_you);
|
||||
|
@ -38,6 +38,7 @@ public class AuthFragment extends BaseMwmToolbarFragment
|
|||
osmAuthDelegate.onViewCreated(view, savedInstanceState);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected ToolbarController onCreateToolbarController(@NonNull View root)
|
||||
{
|
||||
|
|
|
@ -150,6 +150,7 @@ public class EditorHostFragment extends BaseMwmToolbarFragment
|
|||
return mIsNewObject ? R.string.editor_add_place_title : R.string.editor_edit_place_title;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected ToolbarController onCreateToolbarController(@NonNull View root)
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@ public class OsmAuthFragment extends BaseMwmToolbarFragment implements View.OnCl
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mDelegate = new OsmAuthFragmentDelegate(this)
|
||||
|
@ -80,6 +80,7 @@ public class OsmAuthFragment extends BaseMwmToolbarFragment implements View.OnCl
|
|||
UiUtils.hide(mProgress);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected ToolbarController onCreateToolbarController(@NonNull View root)
|
||||
{
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.content.Intent;
|
|||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
@ -79,7 +80,7 @@ public class ProfileFragment extends AuthFragment implements View.OnClickListene
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
getToolbarController().setTitle(R.string.profile);
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.mapswithme.maps.editor;
|
|||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.IntRange;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -32,7 +33,7 @@ public class ReportFragment extends BaseMwmToolbarFragment implements View.OnCli
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
getToolbarController().setTitle(R.string.editor_report_problem_title);
|
||||
|
|
|
@ -173,6 +173,7 @@ public class FilterFragment extends BaseMwmToolbarFragment
|
|||
super.onStop();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected ToolbarController onCreateToolbarController(@NonNull View root)
|
||||
{
|
||||
|
|
|
@ -90,6 +90,7 @@ public class UGCEditorFragment extends BaseMwmAuthorizationFragment
|
|||
});
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected ToolbarController onCreateToolbarController(@NonNull View root)
|
||||
{
|
||||
|
|
|
@ -8,26 +8,35 @@ import android.support.annotation.Nullable;
|
|||
import android.support.v4.app.Fragment;
|
||||
import android.text.Html;
|
||||
import android.text.Spanned;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mapswithme.maps.DisabledBrowserMovementMethod;
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.auth.BaseMwmAuthorizationFragment;
|
||||
import com.mapswithme.maps.dialog.AlertDialog;
|
||||
import com.mapswithme.maps.widget.ToolbarController;
|
||||
import com.mapswithme.util.ConnectionState;
|
||||
|
||||
public class UgcSharingOptionsFragment extends BaseMwmAuthorizationFragment
|
||||
{
|
||||
private static final String NO_NETWORK_CONNECTION_DIALOG_TAG = "no_network_connection_dialog";
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected ToolbarController onCreateToolbarController(@NonNull View root)
|
||||
{
|
||||
return new ToolbarController(root);
|
||||
return new ToolbarController(root, getActivity())
|
||||
{
|
||||
@Override
|
||||
public void onUpClick()
|
||||
{
|
||||
getActivity().finish();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -40,10 +49,9 @@ public class UgcSharingOptionsFragment extends BaseMwmAuthorizationFragment
|
|||
TextView licenceAgreementText = root.findViewById(R.id.license_agreement_message);
|
||||
|
||||
String src = getResources().getString(R.string.ugc_routes_user_agreement,
|
||||
/* FIXME */
|
||||
Framework.nativeGetPrivacyPolicyLink());
|
||||
Spanned spanned = Html.fromHtml(src);
|
||||
licenceAgreementText.setMovementMethod(DisabledBrowserMovementMethod.getInstance());
|
||||
licenceAgreementText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
licenceAgreementText.setText(spanned);
|
||||
return root;
|
||||
}
|
||||
|
@ -71,10 +79,10 @@ public class UgcSharingOptionsFragment extends BaseMwmAuthorizationFragment
|
|||
return;
|
||||
}
|
||||
|
||||
if (hasAuthToken())
|
||||
if (isAuthorized())
|
||||
openTagsScreen();
|
||||
else
|
||||
requestAuth();
|
||||
authorize();
|
||||
}
|
||||
|
||||
private void showNoNetworkConnectionDialog()
|
||||
|
@ -96,21 +104,11 @@ public class UgcSharingOptionsFragment extends BaseMwmAuthorizationFragment
|
|||
return !ConnectionState.isConnected();
|
||||
}
|
||||
|
||||
private void requestAuth()
|
||||
{
|
||||
getAuthorizer().authorize();
|
||||
}
|
||||
|
||||
private void openTagsScreen()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private boolean hasAuthToken()
|
||||
{
|
||||
return getAuthorizer().isAuthorized();
|
||||
}
|
||||
|
||||
private void onGetDirectLinkClicked()
|
||||
{
|
||||
|
||||
|
@ -120,7 +118,6 @@ public class UgcSharingOptionsFragment extends BaseMwmAuthorizationFragment
|
|||
public void onActivityResult(int requestCode, int resultCode, Intent data)
|
||||
{
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
/*FIXME*/
|
||||
if (requestCode == 1 && resultCode == Activity.RESULT_OK)
|
||||
requestPublishing(data);
|
||||
}
|
||||
|
@ -153,18 +150,4 @@ public class UgcSharingOptionsFragment extends BaseMwmAuthorizationFragment
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
private class ToolbarController extends com.mapswithme.maps.widget.ToolbarController
|
||||
{
|
||||
public ToolbarController(View root)
|
||||
{
|
||||
super(root, UgcSharingOptionsFragment.this.getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpClick()
|
||||
{
|
||||
getActivity().finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|