[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Revert "Add tab and shift+tab to blocked triggers list"

2017-12-16 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398647 )

Change subject: Revert "Add tab and shift+tab to blocked triggers list"
..

Revert "Add tab and shift+tab to blocked triggers list"

It seems that blocking tab and shift+tab does makes it hard to post
comments /create posts using StructuredDiscussions when the user does
that in "visual editing" mode[1].

As there doesn't seem to be much value in blocking 'Tab' don't block it.
In case the user accidentally hit 'Tab' he could always get back using
a 'Shift+Tab'.

This reverts commit b89ea541f9579d30210a478231d8449812a6eb2c.

[1]: cf. https://www.mediawiki.org/wiki/Topic:Tzmpo1gjj2gv2ugy

Change-Id: I12ea52c6c3116c678293cc19b838681e4cc6d665
---
M src/ce/ve.ce.Surface.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/47/398647/1

diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index ae35351..9b281a0 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -1221,8 +1221,8 @@
 ve.ce.Surface.prototype.isBlockedTrigger = function ( trigger ) {
var platformKey = ve.getSystemPlatform() === 'mac' ? 'mac' : 'pc',
blocked = {
-   mac: [ 'meta+b', 'meta+i', 'meta+u', 'meta+z', 
'meta+y', 'meta+shift+z', 'tab', 'shift+tab', 'meta+[', 'meta+]' ],
-   pc: [ 'ctrl+b', 'ctrl+i', 'ctrl+u', 'ctrl+z', 'ctrl+y', 
'ctrl+shift+z', 'tab', 'shift+tab' ]
+   mac: [ 'meta+b', 'meta+i', 'meta+u', 'meta+z', 
'meta+y', 'meta+shift+z', 'meta+[', 'meta+]'],
+   pc: [ 'ctrl+b', 'ctrl+i', 'ctrl+u', 'ctrl+z', 'ctrl+y', 
'ctrl+shift+z' ]
};
 
return blocked[ platformKey ].indexOf( trigger.toString() ) !== -1;

-- 
To view, visit https://gerrit.wikimedia.org/r/398647
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I12ea52c6c3116c678293cc19b838681e4cc6d665
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Fix stale comment

2017-12-16 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398646 )

Change subject: Fix stale comment
..

Fix stale comment

Change-Id: Ie506f7199ccc603548cac6490e6097c9e2ca
---
M src/ce/keydownhandlers/ve.ce.LinearTabKeyDownHandler.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/46/398646/1

diff --git a/src/ce/keydownhandlers/ve.ce.LinearTabKeyDownHandler.js 
b/src/ce/keydownhandlers/ve.ce.LinearTabKeyDownHandler.js
index a60cbf8..510dcbe 100644
--- a/src/ce/keydownhandlers/ve.ce.LinearTabKeyDownHandler.js
+++ b/src/ce/keydownhandlers/ve.ce.LinearTabKeyDownHandler.js
@@ -34,7 +34,7 @@
 /**
  * @inheritdoc
  *
- * Handle escape key down events with a linear selection while table editing.
+ * Handle Tab key down events with a linear selection while table editing.
  */
 ve.ce.LinearTabKeyDownHandler.static.execute = function ( surface, e ) {
var activeTableNode = surface.getActiveNode() && 
surface.getActiveNode().findParent( ve.ce.TableNode );

-- 
To view, visit https://gerrit.wikimedia.org/r/398646
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie506f7199ccc603548cac6490e6097c9e2ca
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Use consistent "range" wordings

2017-12-13 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398013 )

Change subject: Use consistent "range" wordings
..

Use consistent "range" wordings

It's better to use "to" to denote the end of a range when the start
of range is denoted with "from".

Change-Id: Id597f14f5ffd891b8e7fef7d22a6a90fe6c6a9f8
---
M app/src/main/res/values/strings.xml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/13/398013/1

diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index 50d1fd4..a0acaa5 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -597,7 +597,7 @@
 
 On this day
 More historical events on this day
-%1$s events from %2$s - %3$d
+%1$s events from %2$s to %3$d
 On this day
 This year
 

-- 
To view, visit https://gerrit.wikimedia.org/r/398013
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id597f14f5ffd891b8e7fef7d22a6a90fe6c6a9f8
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Onboarding: center position the text in landscape mode

2017-09-06 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/376324 )

Change subject: Onboarding: center position the text in landscape mode
..

Onboarding: center position the text in landscape mode

While at it, use fully qualified name to specify the parent tag
of a merge element.

Bug: T174561
Change-Id: If4024285f180d2c07c8b0be91676653beade1410
---
M app/src/main/res/layout-land/view_onboarding_page.xml
M app/src/main/res/layout/view_onboarding_page.xml
2 files changed, 12 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/24/376324/1

diff --git a/app/src/main/res/layout-land/view_onboarding_page.xml 
b/app/src/main/res/layout-land/view_onboarding_page.xml
index b5f4011..7a7a2d5 100644
--- a/app/src/main/res/layout-land/view_onboarding_page.xml
+++ b/app/src/main/res/layout-land/view_onboarding_page.xml
@@ -2,11 +2,12 @@
 http://schemas.android.com/apk/res/android;
 xmlns:app="http://schemas.android.com/apk/res-auto;
 xmlns:tools="http://schemas.android.com/tools;
-tools:parentTag="LinearLayout"
+tools:parentTag="android.widget.LinearLayout"
 tools:orientation="horizontal"
 tools:background="@drawable/onboarding_gradient_background_135"
 tools:layout_width="match_parent"
 tools:layout_height="match_parent">
+
 
 
 
-
-
-
+android:layout_height="wrap_content"
+android:orientation="vertical"
+android:layout_weight="1"
+android:layout_gravity="center">
 
 
+
 
 
 
@@ -105,14 +102,12 @@
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_marginTop="8dp"
+android:layout_gravity="center_horizontal"
 android:text="@string/description_edit_tutorial_promise"
-android:gravity="center"
 android:textAlignment="center"
 android:textSize="12sp"
 android:textColor="@android:color/white" />
 
-
-
-
+
 
 
\ No newline at end of file
diff --git a/app/src/main/res/layout/view_onboarding_page.xml 
b/app/src/main/res/layout/view_onboarding_page.xml
index 6d90c68..69a01e0 100644
--- a/app/src/main/res/layout/view_onboarding_page.xml
+++ b/app/src/main/res/layout/view_onboarding_page.xml
@@ -2,7 +2,7 @@
 http://schemas.android.com/apk/res/android;
 xmlns:app="http://schemas.android.com/apk/res-auto;
 xmlns:tools="http://schemas.android.com/tools;
-tools:parentTag="LinearLayout"
+tools:parentTag="android.widget.LinearLayout"
 tools:orientation="vertical"
 tools:background="@drawable/onboarding_gradient_background_135"
 tools:layout_width="match_parent"

-- 
To view, visit https://gerrit.wikimedia.org/r/376324
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4024285f180d2c07c8b0be91676653beade1410
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Disable the skip button for the Description edit tutorial

2017-08-29 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/374630 )

Change subject: Disable the skip button for the Description edit tutorial
..

Disable the skip button for the Description edit tutorial

The second screen of the tutorial has a 'promise message'. It doesn't
make sense to allow the user to skip the tutorial as the 'promise message'
might not be seen by him when he skips. Moreover, it's just two screens and
has very few wordings and it possibly won't hurt the user when skipping is
not allowed.

So, don't allow skipping of the description edit tutorial.

Bug: T173657
Change-Id: Ia6eea7118ac339445abcbf3bef42048cec2834b3
---
M app/src/main/java/org/wikipedia/onboarding/OnboardingFragment.java
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/30/374630/1

diff --git a/app/src/main/java/org/wikipedia/onboarding/OnboardingFragment.java 
b/app/src/main/java/org/wikipedia/onboarding/OnboardingFragment.java
index f215070..2e263d5 100644
--- a/app/src/main/java/org/wikipedia/onboarding/OnboardingFragment.java
+++ b/app/src/main/java/org/wikipedia/onboarding/OnboardingFragment.java
@@ -22,7 +22,7 @@
 
 public abstract class OnboardingFragment extends Fragment implements 
BackPressedHandler {
 @BindView(R.id.fragment_pager) ViewPager viewPager;
-@BindView(R.id.fragment_onboarding_skip_button) View skipButton;
+@BindView(R.id.fragment_onboarding_skip_button) protected View skipButton;
 @BindView(R.id.fragment_onboarding_forward_button) View forwardButton;
 @BindView(R.id.fragment_onboarding_done_button) TextView doneButton;
 private Unbinder unbinder;
@@ -104,7 +104,7 @@
 return viewPager.getCurrentItem() == viewPager.getAdapter().getCount() 
- 1;
 }
 
-private void updateButtonState() {
+protected void updateButtonState() {
 if (atLastPage()) {
 skipButton.setVisibility(View.GONE);
 forwardButton.setVisibility(View.GONE);

-- 
To view, visit https://gerrit.wikimedia.org/r/374630
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6eea7118ac339445abcbf3bef42048cec2834b3
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Remove the page title left behind when a page load fails

2017-08-25 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373883 )

Change subject: Remove the page title left behind when a page load fails
..

Remove the page title left behind when a page load fails

Bug: T163115
Bug: T173756
Change-Id: Id8a4c6f917c1c0a31a61151019388da1f80fae51
---
M app/src/main/java/org/wikipedia/page/PageActivity.java
M app/src/main/java/org/wikipedia/page/PageFragment.java
M app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java
3 files changed, 21 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/83/373883/1

diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java 
b/app/src/main/java/org/wikipedia/page/PageActivity.java
index 087f962..d0c1195 100644
--- a/app/src/main/java/org/wikipedia/page/PageActivity.java
+++ b/app/src/main/java/org/wikipedia/page/PageActivity.java
@@ -152,7 +152,7 @@
 pageFragment = (PageFragment) 
getSupportFragmentManager().findFragmentById(R.id.page_fragment);
 
 setSupportActionBar(toolbar);
-getSupportActionBar().setTitle("");
+clearActionBarTitle();
 getSupportActionBar().setDisplayHomeAsUpEnabled(true);
 
 toolbarHideHandler = new PageToolbarHideHandler(toolbarContainerView);
@@ -432,7 +432,7 @@
 }
 return;
 }
-getSupportActionBar().setTitle("");
+clearActionBarTitle();
 app.getSessionFunnel().backPressed();
 if (pageFragment.onBackPressed()) {
 return;
@@ -575,7 +575,7 @@
 
 @Override
 public void onPageLoadErrorRetry() {
-getSupportActionBar().setTitle("");
+clearActionBarTitle();
 }
 
 @Override
@@ -756,6 +756,11 @@
 currentActionMode = null;
 }
 
+// clears the title left behind in case a page load fails
+protected void clearActionBarTitle() {
+getSupportActionBar().setTitle("");
+}
+
 private void registerBus() {
 bus = app.getBus();
 bus.register(busMethods);
diff --git a/app/src/main/java/org/wikipedia/page/PageFragment.java 
b/app/src/main/java/org/wikipedia/page/PageFragment.java
index 462cf51..2513a87 100755
--- a/app/src/main/java/org/wikipedia/page/PageFragment.java
+++ b/app/src/main/java/org/wikipedia/page/PageFragment.java
@@ -12,6 +12,7 @@
 import android.support.design.widget.BottomSheetDialogFragment;
 import android.support.design.widget.TabLayout;
 import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.app.AppCompatActivity;
@@ -955,6 +956,8 @@
 }
 
 errorView.setVisibility(View.GONE);
+clearActivityActionBarTitle();
+
 tabLayout.enableAllTabs();
 errorState = false;
 
@@ -1032,6 +1035,13 @@
 });
 }
 
+// clears the title left behind in the corresponding page activity
+protected void clearActivityActionBarTitle() {
+FragmentActivity currentActivity = getActivity();
+if (currentActivity instanceof PageActivity)
+((PageActivity) currentActivity).clearActionBarTitle();
+}
+
 private void openInNewTab(@NonNull PageTitle title, @NonNull HistoryEntry 
entry, int position) {
 if (shouldCreateNewTab()) {
 // create a new tab
diff --git a/app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java 
b/app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java
index ae22167..b4d09ae 100644
--- a/app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java
+++ b/app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java
@@ -180,6 +180,9 @@
 if (backStack.isEmpty()) {
 return;
 }
+
+fragment.clearActivityActionBarTitle();
+
 PageBackStackItem item = backStack.get(backStack.size() - 1);
 // display the page based on the backstack item, stage the scrollY 
position based on
 // the backstack item.

-- 
To view, visit https://gerrit.wikimedia.org/r/373883
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8a4c6f917c1c0a31a61151019388da1f80fae51
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Onboarding: give some space between buttons and screen

2017-08-24 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373629 )

Change subject: Onboarding: give some space between buttons and screen
..

Onboarding: give some space between buttons and screen

Keeping the buttons close to the end of the screen makes it
harder to access them.

So, give some space between the button and the screen borders.

Change-Id: If7b453463aa440e7b5d5c93c74f2c9b044b1cd65
Credits: Google slides
---
M app/src/main/res/layout/fragment_onboarding_pager.xml
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/29/373629/1

diff --git a/app/src/main/res/layout/fragment_onboarding_pager.xml 
b/app/src/main/res/layout/fragment_onboarding_pager.xml
index dc5bdce..ea18dbd 100644
--- a/app/src/main/res/layout/fragment_onboarding_pager.xml
+++ b/app/src/main/res/layout/fragment_onboarding_pager.xml
@@ -28,7 +28,8 @@
 style="@style/Widget.AppCompat.Button.Borderless"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
-android:layout_margin="0dp"
+android:layout_marginLeft="16dp"
+android:layout_marginStart="16dp"
 android:text="@string/onboarding_skip"
 android:textColor="@android:color/white" />
 
@@ -55,6 +56,8 @@
 app:srcCompat="@drawable/ic_chevron_forward_white_24dp"
 android:scaleType="center"
 android:clickable="true"
+android:layout_marginRight="16dp"
+android:layout_marginEnd="16dp"
 android:background="?attr/selectableItemBackgroundBorderless"
 android:contentDescription="@string/onboarding_continue"/>
 
@@ -63,7 +66,8 @@
 style="@style/Widget.AppCompat.Button.Borderless"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
-android:layout_margin="0dp"
+android:layout_marginRight="8dp"
+android:layout_marginEnd="8dp"
 android:text="@string/onboarding_get_started"
 android:textColor="@android:color/white" />
 

-- 
To view, visit https://gerrit.wikimedia.org/r/373629
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If7b453463aa440e7b5d5c93c74f2c9b044b1cd65
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Separate different parts of the message with a new line

2017-08-09 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370817 )

Change subject: Separate different parts of the message with a new line
..

Separate different parts of the message with a new line

It's better to separate the different parts of the message
with a new line than a space as it could improve improve it's
readability.

Change-Id: I0d8735d0555c89844ae7c012b3b4494304b183ac
---
M app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewErrorView.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/17/370817/1

diff --git 
a/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewErrorView.java 
b/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewErrorView.java
index 692f8f8..0c7a540 100644
--- a/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewErrorView.java
+++ b/app/src/main/java/org/wikipedia/page/linkpreview/LinkPreviewErrorView.java
@@ -61,7 +61,7 @@
 // message and subtitle in the full page view.  Figure out a good way 
to handle this.
 if (errorType == LinkPreviewErrorType.OFFLINE) {
 String message = 
getResources().getString(R.string.page_offline_notice_cannot_load_while_offline)
-+ " " + 
getResources().getString(R.string.page_offline_notice_add_to_reading_list);
++ "\n" + 
getResources().getString(R.string.page_offline_notice_add_to_reading_list);
 textView.setText(message);
 } else {
 
textView.setText(getContext().getResources().getString(errorType.text()));

-- 
To view, visit https://gerrit.wikimedia.org/r/370817
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d8735d0555c89844ae7c012b3b4494304b183ac
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Show edit summary across multiple lines

2017-08-09 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370804 )

Change subject: Show edit summary across multiple lines
..

Show edit summary across multiple lines

This allows users to read the long summaries as a whole instead
of having to scroll through the summary to read them which could
be hard, sometimes.

While at it, change the file's to be more appropriate.

Change-Id: Ia2af44bddeac7e8d653d5e7ebd5baf90049eea63
---
M app/src/main/java/org/wikipedia/edit/summaries/EditSummaryFragment.java
M app/src/main/res/layout/activity_edit_section.xml
R app/src/main/res/layout/fragment_preview_edit_summary.xml
3 files changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/04/370804/1

diff --git 
a/app/src/main/java/org/wikipedia/edit/summaries/EditSummaryFragment.java 
b/app/src/main/java/org/wikipedia/edit/summaries/EditSummaryFragment.java
index 6df478c..59f3722 100644
--- a/app/src/main/java/org/wikipedia/edit/summaries/EditSummaryFragment.java
+++ b/app/src/main/java/org/wikipedia/edit/summaries/EditSummaryFragment.java
@@ -27,7 +27,7 @@
 
 @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container, 
Bundle savedInstanceState) {
-editSummaryContainer = 
inflater.inflate(R.layout.fragment_preview_summary, container, false);
+editSummaryContainer = 
inflater.inflate(R.layout.fragment_preview_edit_summary, container, false);
 summaryText = (AutoCompleteTextView) 
editSummaryContainer.findViewById(R.id.edit_summary_edit);
 
 // Explicitly enable standard dictionary autocompletion in the edit 
summary box
diff --git a/app/src/main/res/layout/activity_edit_section.xml 
b/app/src/main/res/layout/activity_edit_section.xml
index e6c42c5..fae51d6 100644
--- a/app/src/main/res/layout/activity_edit_section.xml
+++ b/app/src/main/res/layout/activity_edit_section.xml
@@ -54,7 +54,7 @@
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 class="org.wikipedia.edit.summaries.EditSummaryFragment"
-tools:layout="@layout/fragment_preview_summary"/>
+tools:layout="@layout/fragment_preview_edit_summary"/>
 
 
 
diff --git a/app/src/main/res/layout/fragment_preview_summary.xml 
b/app/src/main/res/layout/fragment_preview_edit_summary.xml
similarity index 92%
rename from app/src/main/res/layout/fragment_preview_summary.xml
rename to app/src/main/res/layout/fragment_preview_edit_summary.xml
index d5ec923..21a437c 100644
--- a/app/src/main/res/layout/fragment_preview_summary.xml
+++ b/app/src/main/res/layout/fragment_preview_edit_summary.xml
@@ -24,8 +24,7 @@
 android:paddingRight="16dp"
 android:imeOptions="actionDone|flagNoExtractUi"
 android:maxLength="255"
-android:textColor="?attr/edit_text_color"
-android:maxLines="1" />
+android:textColor="?attr/edit_text_color" />
 
 
 

-- 
To view, visit https://gerrit.wikimedia.org/r/370804
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2af44bddeac7e8d653d5e7ebd5baf90049eea63
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Shorten the rationale

2017-08-08 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370643 )

Change subject: Shorten the rationale
..

Shorten the rationale

The rationale shown when storage permission is revoked seems a bit
too long and makes the assumption that the user would see the dialog
to grant permission each time he does the concerned action. It's not
always the fact as the user has the choice of "Don't show again" and
may have used it to avoid the dialog from popping up.

Shorten the message thus making no assumptions about the dialog being
shown.

Change-Id: Icd554217c9cf3cf955e4ddfe7c3ce2ba24d9a1a8
---
M app/src/main/res/values/strings.xml
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/43/370643/1

diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index c412281..a9ac051 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -218,7 +218,7 @@
 Downloading fileā€¦
 File saved successfully.
 Could not play the 
video.
-Permission to 
write to storage on your device is required for saving images. Please try 
again, and grant the requested permission.
+Permission to 
write to storage on your device is required for saving images.
 Cannot save file
 \"%1$s\" on @Wikipedia: %2$s
 Tap to expand
@@ -459,7 +459,7 @@
 
 
 
-Permission to access 
storage on your device is required for offline browsing. Please try again, and 
grant the requested permission.
+Permission to access 
storage on your device is required for offline browsing.
 Permission not granted to 
read from device storage.
 You are now browsing Wikipedia in offline 
mode. Please note that offline articles may not be fully up to date with the 
online version.
 My compilations

-- 
To view, visit https://gerrit.wikimedia.org/r/370643
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd554217c9cf3cf955e4ddfe7c3ce2ba24d9a1a8
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Handle other domain links correctly

2017-08-07 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370467 )

Change subject: Handle other domain links correctly
..

Handle other domain links correctly

Links originating from file pages might be links to other domains such as
commons.wikimedia.org, upload.wikimedia.org etc. They were incorrectly
prefixed with the Wikisite prefix (https://en.wikipedia.org) which resulted
in incorrect links being sent to the Url handler. This regression was
introduced as a consequence of,

  db160f6 Consolidate/solidify LinkHandler

Check if they are other domain links and handle them correctly. While at it,
reformat a piece of code to be more readable.

Change-Id: I6c2091af9fc4a0d4ba5c6230fbe38f0c928a4fe8
---
M app/src/main/java/org/wikipedia/page/LinkHandler.java
1 file changed, 10 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/67/370467/1

diff --git a/app/src/main/java/org/wikipedia/page/LinkHandler.java 
b/app/src/main/java/org/wikipedia/page/LinkHandler.java
index 66f1fd2..bccf1f6 100644
--- a/app/src/main/java/org/wikipedia/page/LinkHandler.java
+++ b/app/src/main/java/org/wikipedia/page/LinkHandler.java
@@ -48,11 +48,18 @@
 
 @Override
 public void onUrlClick(@NonNull String href, @Nullable String titleString) 
{
+// other domain links
+if (href.startsWith("//")) {
+href = "https:" + href;
+}
+
 Uri uri = Uri.parse(href);
 if (!href.startsWith("http:") && !href.startsWith("https:")) {
-uri = uri.buildUpon().scheme(getWikiSite().scheme())
-.authority(getWikiSite().authority())
-.path(href).build();
+uri = uri.buildUpon()
+ .scheme(getWikiSite().scheme())
+ .authority(getWikiSite().authority())
+ .path(href)
+ .build();
 }
 
 Log.d("Wikipedia", "Link clicked was " + uri.toString());

-- 
To view, visit https://gerrit.wikimedia.org/r/370467
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c2091af9fc4a0d4ba5c6230fbe38f0c928a4fe8
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Prefix the help text to improve readability

2017-07-24 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367452 )

Change subject: Prefix the help text to improve readability
..

Prefix the help text to improve readability

The help text shown while trying to load a page while
offline isn't user friendly. Prefix it with "Hint: " to
make it more readable and thus giving it a touch of user
friendliness.

Change-Id: I4fb35426d71e0f5739d9e5f331bfe95c31cdce3c
---
M app/src/main/res/values/strings.xml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/52/367452/1

diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index ab12250..1521b6c 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -252,7 +252,7 @@
 Read article
 Add to reading list
 Article 
cannot be loaded while offline.
-Add the article to 
a reading list and it will be downloaded once you\'re back online.
+Hint: Add the 
article to a reading list and it will be downloaded once you\'re back 
online.
 You are reading an offline 
version of this article saved on %s.
 You are 
reading an offline version of this article from a compilation downloaded on 
%s.
 Get directions

-- 
To view, visit https://gerrit.wikimedia.org/r/367452
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4fb35426d71e0f5739d9e5f331bfe95c31cdce3c
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Changeed the download location of files

2017-06-03 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357020 )

Change subject: Changeed the download location of files
..

Changeed the download location of files

Previously the location of the download
was inside app directory. It was changed
to a public directory to,

 - Allow users to easily access the
   downloaded files

 - Allow other media applications to identify
   the files

Things that this commit introduces,

 - Corrected a variable name

 - Download files into a subdirectory that identifies
   the app

   - This is done to help the users who download multiple photos

   - Prevents the common "Pictures" folder from being cluttered up

Bug: T166434
Change-Id: I6b97b47b9b7dac6e4d3b23a25dda2096b6f55fa3
---
M app/src/main/java/org/wikipedia/gallery/MediaDownloadReceiver.java
1 file changed, 21 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/20/357020/1

diff --git a/app/src/main/java/org/wikipedia/gallery/MediaDownloadReceiver.java 
b/app/src/main/java/org/wikipedia/gallery/MediaDownloadReceiver.java
index f67f5fb..85fa628 100644
--- a/app/src/main/java/org/wikipedia/gallery/MediaDownloadReceiver.java
+++ b/app/src/main/java/org/wikipedia/gallery/MediaDownloadReceiver.java
@@ -18,6 +18,8 @@
 import org.wikipedia.util.FeedbackUtil;
 import org.wikipedia.util.FileUtil;
 
+import java.io.File;
+
 public class MediaDownloadReceiver extends BroadcastReceiver {
 private static final String FILE_NAMESPACE = "File:";
 
@@ -31,30 +33,38 @@
 
 public void download(@NonNull FeaturedImage featuredImage) {
 String filename = FileUtil.sanitizeFileName(featuredImage.title());
-String targetDirectory = Environment.DIRECTORY_PICTURES;
-performDownloadRequest(featuredImage.image().source(), 
targetDirectory, filename, null);
+String targetDirectoryType = Environment.DIRECTORY_PICTURES;
+performDownloadRequest(featuredImage.image().source(), 
targetDirectoryType, filename, null);
 }
 
 public void download(@NonNull GalleryItem galleryItem) {
 String saveFilename = 
FileUtil.sanitizeFileName(trimFileNamespace(galleryItem.getName()));
-String targetDirectory;
+String targetDirectoryType;
 if (FileUtil.isVideo(galleryItem.getMimeType())) {
-targetDirectory = Environment.DIRECTORY_MOVIES;
+targetDirectoryType = Environment.DIRECTORY_MOVIES;
 } else if (FileUtil.isAudio(galleryItem.getMimeType())) {
-targetDirectory = Environment.DIRECTORY_MUSIC;
+targetDirectoryType = Environment.DIRECTORY_MUSIC;
 } else if (FileUtil.isImage(galleryItem.getMimeType())) {
-targetDirectory = Environment.DIRECTORY_PICTURES;
+targetDirectoryType = Environment.DIRECTORY_PICTURES;
 } else {
-targetDirectory = Environment.DIRECTORY_DOWNLOADS;
+targetDirectoryType = Environment.DIRECTORY_DOWNLOADS;
 }
-performDownloadRequest(Uri.parse(galleryItem.getUrl()), 
targetDirectory, saveFilename,
+performDownloadRequest(Uri.parse(galleryItem.getUrl()), 
targetDirectoryType, saveFilename,
 galleryItem.getMimeType());
 }
 
-private void performDownloadRequest(@NonNull Uri uri, @NonNull String 
targetDirectory,
-@NonNull String filename, @Nullable 
String mimeType) {
+private void performDownloadRequest(@NonNull Uri uri, @NonNull String 
targetDirectoryType,
+@NonNull String fileName, @Nullable 
String mimeType) {
+final String downloadSubFolderName = "Wikipedia";
+final File categoryFolder = 
Environment.getExternalStoragePublicDirectory(targetDirectoryType);
+final File destinationFolder = new File(categoryFolder, 
downloadSubFolderName);
+final File destinationFile = new File(destinationFolder, fileName);
+
+// creates a directory if it doesn't exists else it's harmless
+destinationFolder.mkdir();
+
 DownloadManager.Request request = new DownloadManager.Request(uri);
-request.setDestinationInExternalFilesDir(activity, targetDirectory, 
filename);
+request.setDestinationUri(Uri.fromFile(destinationFile));
 
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
 if (mimeType != null) {
 request.setMimeType(mimeType);

-- 
To view, visit https://gerrit.wikimedia.org/r/357020
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b97b47b9b7dac6e4d3b23a25dda2096b6f55fa3
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: fix for syntax highlighter problem that does not highlight l...

2016-11-19 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/322430

Change subject: fix for syntax highlighter problem that does not highlight last 
word and that matches start and end symbols incorrectly
..

fix for syntax highlighter problem that does not highlight last word and that 
matches start and end symbols incorrectly

Change-Id: I5a419b357dcd37b882d37d6a1307bc750e959714
---
M app/src/main/java/org/wikipedia/edit/richtext/SyntaxHighlighter.java
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/30/322430/1

diff --git 
a/app/src/main/java/org/wikipedia/edit/richtext/SyntaxHighlighter.java 
b/app/src/main/java/org/wikipedia/edit/richtext/SyntaxHighlighter.java
index 8f1a43d..dad9d5d 100644
--- a/app/src/main/java/org/wikipedia/edit/richtext/SyntaxHighlighter.java
+++ b/app/src/main/java/org/wikipedia/edit/richtext/SyntaxHighlighter.java
@@ -217,7 +217,7 @@
 
 for (SyntaxRule syntaxItem : syntaxRules) {
 
-if (i + syntaxItem.getStartSymbol().length() >= 
text.length()) {
+if (i + syntaxItem.getStartSymbol().length() > 
text.length()) {
 continue;
 }
 
@@ -263,7 +263,7 @@
 }
 }
 if (pass) {
-if (spanStack.size() > 0) {
+if (spanStack.size() > 0 && 
spanStack.peek().getSyntaxRule().equals(syntaxItem)) {
 newSpanInfo = spanStack.pop();
 newSpanInfo.setEnd(i + 
syntaxItem.getEndSymbol().length());
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/322430
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a419b357dcd37b882d37d6a1307bc750e959714
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits