Skip to content
This repository has been archived by the owner on Jan 10, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/3.0.16'
Browse files Browse the repository at this point in the history
  • Loading branch information
fgei committed Apr 28, 2017
2 parents 6ed62b2 + 201e10e commit 371102c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.duckduckgo.mobile.android"
android:installLocation="auto"
android:versionCode="77"
android:versionName="3.0.15">
android:versionCode="78"
android:versionName="3.0.16">

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
2 changes: 1 addition & 1 deletion res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
<string name="instruction_2_b">3-dot menu</string>
<string name="instruction_3_a">Tap</string>
<string name="instruction_3_b">Add to Home screen</string>
<string name="instruction_done">I’ve done this!</string>
<string name="instruction_done">Done!</string>

<!-- SSL Certificate dialogs -->
<!-- Title for an SSL Certificate dialog -->
Expand Down
11 changes: 10 additions & 1 deletion src/com/duckduckgo/mobile/android/activity/DuckDuckGo.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.duckduckgo.mobile.android.adapters.RecentResultCursorAdapter;
import com.duckduckgo.mobile.android.bus.BusProvider;
import com.duckduckgo.mobile.android.container.DuckDuckGoContainer;
import com.duckduckgo.mobile.android.dialogs.InstructionDialogFragment;
import com.duckduckgo.mobile.android.dialogs.NewSourcesDialogBuilder;
import com.duckduckgo.mobile.android.dialogs.menuDialogs.HistorySearchMenuDialog;
import com.duckduckgo.mobile.android.dialogs.menuDialogs.HistoryStoryMenuDialog;
Expand Down Expand Up @@ -170,7 +171,7 @@ public void onCreate(Bundle savedInstanceState) {
setTheme(R.style.DDGTheme);
onboardingHelper = new OnboardingHelper(this);
if(onboardingHelper.shouldShowOnboarding()) {
startActivity(OnboardingActivity.getStartIntent(this));
showOnboardingInstruction();
}
Log.d(TAG, "on create");
canCommitFragmentSafely = true;
Expand Down Expand Up @@ -762,6 +763,14 @@ private void stopAction() {
getSearchField().setCompoundDrawables(null, null, null, null);
}

private void showOnboardingInstruction() {
int instructionType = onboardingHelper.isDefaultBrowserFirefox()
? InstructionDialogFragment.EXTRA_INSTRUCTION_FIREFOX
: InstructionDialogFragment.EXTRA_INSTRUCTION_CHROME;
InstructionDialogFragment.newInstance(instructionType, true)
.show(getSupportFragmentManager(), InstructionDialogFragment.TAG);
}

public void searchOrGoToUrl(final String text, final SESSIONTYPE sessionType) {
if(DDGControlVar.useExternalBrowser==DDGConstants.ALWAYS_INTERNAL) {
if(fragmentManager.findFragmentByTag(WebFragment.TAG)==null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package com.duckduckgo.mobile.android.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatDialogFragment;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.text.style.StyleSpan;
import android.transition.TransitionManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -49,7 +52,7 @@ public static InstructionDialogFragment newInstance(int instructionType, boolean
private static final String EXTRA_INSTRUCTION_TYPE = "instruction_type";
private static final String EXTRA_DISABLE_DISMISS_BUTTON = "disable_dismiss_button";

private static final int INITIAL_DISABLE_TIME = 5000;
private static final int INITIAL_DISABLE_TIME = 1000;

private View firefoxInstructionContainer, chromeInstructionContainer;
private View toggleInstructionContainer;
Expand Down Expand Up @@ -102,6 +105,24 @@ public void onStart() {
}
}

@Override
public void dismiss() {
onboardingHelper.setOnboardingDismissed();
super.dismiss();
}

@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new Dialog(getContext(), getTheme()) {
@Override
public void onBackPressed() {
onboardingHelper.setOnboardingDismissed();
super.onBackPressed();
}
};
}

private void init(Context context, final View rootView) {
onboardingHelper = new OnboardingHelper(context);
transitionRoot = (ViewGroup) rootView;
Expand Down

0 comments on commit 371102c

Please sign in to comment.