Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/src/main/java/fr/free/nrw/commons/WelcomePagerAdapter.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -9,6 +10,7 @@

import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Optional;

public class WelcomePagerAdapter extends PagerAdapter {
static final int[] PAGE_LAYOUTS = new int[]{
Expand All @@ -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
Expand Down Expand Up @@ -53,6 +56,7 @@ public boolean isViewFromObject(View view, Object object) {

@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"){
Expand Down Expand Up @@ -102,5 +106,15 @@ void onClicked() {
}
}

@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();
}
}

}
}
32 changes: 27 additions & 5 deletions app/src/main/res/layout-land/welcome_final.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0c609c"
android:gravity="center"
>

>
<TextView
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="@dimen/large_gap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/welcome_help_button_text"
android:id="@+id/welcomeInfo"
android:layout_gravity="end|top"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:textSize="@dimen/normal_text"
android:textColor="@android:color/white"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center">
<!-- Sorry about the hardcoded sizes here. They're image-related. -->
<LinearLayout
android:layout_width="wrap_content"
Expand Down Expand Up @@ -59,6 +79,8 @@
android:textColor="#0c609c"
android:textStyle="bold"
/>

</LinearLayout>
</LinearLayout>

</LinearLayout>
</RelativeLayout>
30 changes: 26 additions & 4 deletions app/src/main/res/layout/welcome_final.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0c609c"
android:gravity="center_vertical"
>

<LinearLayout
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical">
<LinearLayout
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_height="180dp"
Expand Down Expand Up @@ -60,4 +64,22 @@
android:textStyle="bold"
/>

</LinearLayout>
</LinearLayout>
<TextView
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|end"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap"
android:id="@+id/welcomeInfo"
android:textSize="@dimen/normal_text"
android:textColor="@android:color/white"
android:text="@string/welcome_help_button_text"
android:layout_marginBottom="@dimen/large_gap"
android:paddingBottom="@dimen/large_gap"
/>
</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
<string name="welcome_copyright_subtext">Avoid copyrighted materials you found from the Internet as well as images of posters, book covers, etc.</string>
<string name="welcome_final_text">You think you got it?</string>
<string name="welcome_final_button_text">Yes!</string>
<string name="welcome_help_button_text"><u>More Information</u></string>
<string name="detail_panel_cats_label">Categories</string>
<string name="detail_panel_cats_loading">Loading…</string>
<string name="detail_panel_cats_none">None selected</string>
Expand Down