Fixes : #4855 Copyright warning for beta flavor (#4873)

* xml work done

* testing

* copyright popup added local

* minor changes

* minor changes 2

* picture removed
This commit is contained in:
RISHAV GUPTA 2022-03-07 14:46:14 +05:30 committed by GitHub
parent c626f97fb9
commit 824a82ad2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 0 deletions

View file

@ -15,6 +15,8 @@ import butterknife.OnClick;
import fr.free.nrw.commons.quiz.QuizActivity;
import fr.free.nrw.commons.theme.BaseActivity;
import fr.free.nrw.commons.utils.ConfigUtils;
import android.app.AlertDialog;
import android.widget.Button;
public class WelcomeActivity extends BaseActivity {
@ -25,6 +27,9 @@ public class WelcomeActivity extends BaseActivity {
private WelcomePagerAdapter adapter = new WelcomePagerAdapter();
private boolean isQuiz;
private AlertDialog.Builder dialogBuilder;
private AlertDialog dialog;
Button okButton;
/**
* Initialises exiting fields and dependencies
@ -48,6 +53,15 @@ public class WelcomeActivity extends BaseActivity {
// Enable skip button if beta flavor
if (ConfigUtils.isBetaFlavour()) {
findViewById(R.id.finishTutorialButton).setVisibility(View.VISIBLE);
dialogBuilder = new AlertDialog.Builder(this);
final View contactPopupView = getLayoutInflater().inflate(R.layout.popup_for_copyright,null);
dialogBuilder.setView(contactPopupView);
dialog = dialogBuilder.create();
dialog.show();
okButton = dialog.findViewById(R.id.button_ok);
okButton.setOnClickListener(view -> dialog.dismiss());
}
ButterKnife.bind(this);

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/popup_relative_layout"
android:layout_width="350dp"
android:layout_height="350dp"
android:layout_gravity="center">
<TextView
android:id="@+id/warning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="37dp"
android:text="@string/warning"
android:textColor="#FF0202"
android:textSize="34sp"
android:textStyle="bold" />
<TextView
android:id="@+id/copyright_messege"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/warning"
android:layout_marginTop="21dp"
android:text="@string/copyright_popup"
android:textSize="20sp"
android:textStyle="bold" />
<Button
android:id="@+id/button_ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/copyright_messege"
android:layout_centerHorizontal="true"
android:layout_marginTop="37dp"
android:text="@string/ok" />
</RelativeLayout>

View file

@ -691,4 +691,5 @@ Upload your first media by tapping on the add button.</string>
<string name="feedback_sharing_data_alert">Please remove from this email any information that you are not comfortable sharing publicly. Also, please be aware that your email address with which you are posting, and the associated name and profile picture, will be visible publicly.</string>
<string name="achievements_unavailable_beta">Achievements are only available in the prod flavor.</string>
<string name="leaderboard_unavailable_beta">The leaderboard is only available in the prod flavor.</string>
<string name="copyright_popup">Please only upload pictures you have taken by yourself. Uploaders of copyrighted images will be blocked. This applies to the beta flavor too. Thank you for testing the app!</string>
</resources>