mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Help button (#1415)
* Help button added to tutorial * debug typo removed * Help changed to more info * More option moved to bottom * Alignment changes made
This commit is contained in:
parent
0223c5ab76
commit
6d2c41b91e
4 changed files with 68 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package fr.free.nrw.commons;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.view.PagerAdapter;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -9,6 +10,7 @@ import android.widget.TextView;
|
|||
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import butterknife.Optional;
|
||||
|
||||
public class WelcomePagerAdapter extends PagerAdapter {
|
||||
static final int[] PAGE_LAYOUTS = new int[]{
|
||||
|
|
@ -20,6 +22,7 @@ public class WelcomePagerAdapter extends PagerAdapter {
|
|||
};
|
||||
private static final int PAGE_FINAL = 4;
|
||||
private Callback callback;
|
||||
private ViewGroup container;
|
||||
|
||||
/**
|
||||
* Changes callback to provided one
|
||||
|
|
@ -53,6 +56,7 @@ public class WelcomePagerAdapter extends PagerAdapter {
|
|||
|
||||
@Override
|
||||
public Object instantiateItem(ViewGroup container, int position) {
|
||||
this.container=container;
|
||||
LayoutInflater inflater = LayoutInflater.from(container.getContext());
|
||||
ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false);
|
||||
if( BuildConfig.FLAVOR == "beta"){
|
||||
|
|
@ -102,5 +106,15 @@ public class WelcomePagerAdapter extends PagerAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
@Optional
|
||||
@OnClick(R.id.welcomeInfo)
|
||||
void onHelpClicked () {
|
||||
try {
|
||||
Utils.handleWebUrl(container.getContext(),Uri.parse("https://commons.wikimedia.org/wiki/Help:Contents" ));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue