forked from github/wulkanowy-mirror
CustomTabs fix (#56)
This commit is contained in:
parent
30bb01e9c3
commit
e187493e01
@ -97,14 +97,12 @@ public class LoginActivity extends BaseActivity implements LoginContract.View {
|
|||||||
|
|
||||||
@OnClick(R.id.login_activity_create_text)
|
@OnClick(R.id.login_activity_create_text)
|
||||||
void onCreateAccountButtonClick() {
|
void onCreateAccountButtonClick() {
|
||||||
CommonUtils.openInternalBrowserViewer(getApplicationContext(),
|
CommonUtils.openInternalBrowserViewer(this, AppConstant.VULCAN_CREATE_ACCOUNT_URL);
|
||||||
AppConstant.VULCAN_CREATE_ACCOUNT_URL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnClick(R.id.login_activity_forgot_text)
|
@OnClick(R.id.login_activity_forgot_text)
|
||||||
void onForgotPasswordButtonClick() {
|
void onForgotPasswordButtonClick() {
|
||||||
CommonUtils.openInternalBrowserViewer(getApplicationContext(),
|
CommonUtils.openInternalBrowserViewer(this, AppConstant.VULCAN_FORGOT_PASS_URL);
|
||||||
AppConstant.VULCAN_FORGOT_PASS_URL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.github.wulkanowy.utils;
|
package io.github.wulkanowy.utils;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.app.Activity;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.support.customtabs.CustomTabsIntent;
|
import android.support.customtabs.CustomTabsIntent;
|
||||||
|
|
||||||
@ -12,11 +12,11 @@ public final class CommonUtils {
|
|||||||
throw new IllegalStateException("Utility class");
|
throw new IllegalStateException("Utility class");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void openInternalBrowserViewer(Context context, String url) {
|
public static void openInternalBrowserViewer(Activity activity, String url) {
|
||||||
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
|
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
|
||||||
builder.setToolbarColor(context.getResources().getColor(R.color.colorPrimary));
|
builder.setToolbarColor(activity.getResources().getColor(R.color.colorPrimary));
|
||||||
CustomTabsIntent customTabsIntent = builder.build();
|
CustomTabsIntent customTabsIntent = builder.build();
|
||||||
customTabsIntent.launchUrl(context, Uri.parse(url));
|
customTabsIntent.launchUrl(activity, Uri.parse(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int colorHexToColorName(String hexColor) {
|
public static int colorHexToColorName(String hexColor) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user