mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
issue #1156 fix
This commit is contained in:
parent
671e1e61ab
commit
f9b99f9280
5 changed files with 15 additions and 28 deletions
|
|
@ -15,6 +15,8 @@ import butterknife.OnClick;
|
||||||
import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
||||||
import fr.free.nrw.commons.ui.widget.HtmlTextView;
|
import fr.free.nrw.commons.ui.widget.HtmlTextView;
|
||||||
|
|
||||||
|
import static android.widget.Toast.LENGTH_SHORT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents about screen of this app
|
* Represents about screen of this app
|
||||||
*/
|
*/
|
||||||
|
|
@ -57,10 +59,7 @@ public class AboutActivity extends NavigationBaseActivity {
|
||||||
if(intent.resolveActivity(this.getPackageManager()) != null){
|
if(intent.resolveActivity(this.getPackageManager()) != null){
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
CharSequence text = "No app found to open URL";
|
Toast toast = Toast.makeText(this, getString(R.string.no_web_browser), LENGTH_SHORT);
|
||||||
int duration = Toast.LENGTH_SHORT;
|
|
||||||
|
|
||||||
Toast toast = Toast.makeText(this, text, duration);
|
|
||||||
toast.show();
|
toast.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -76,9 +75,7 @@ public class AboutActivity extends NavigationBaseActivity {
|
||||||
if (browserIntent.resolveActivity(this.getPackageManager()) != null) {
|
if (browserIntent.resolveActivity(this.getPackageManager()) != null) {
|
||||||
startActivity(browserIntent);
|
startActivity(browserIntent);
|
||||||
} else {
|
} else {
|
||||||
CharSequence text = "No app found to open URL";
|
Toast toast = Toast.makeText(this, getString(R.string.no_web_browser), LENGTH_SHORT);
|
||||||
int duration = Toast.LENGTH_SHORT;
|
|
||||||
Toast toast = Toast.makeText(this, text, duration);
|
|
||||||
toast.show();
|
toast.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -91,9 +88,7 @@ public class AboutActivity extends NavigationBaseActivity {
|
||||||
if (browserIntent.resolveActivity(this.getPackageManager()) != null) {
|
if (browserIntent.resolveActivity(this.getPackageManager()) != null) {
|
||||||
startActivity(browserIntent);
|
startActivity(browserIntent);
|
||||||
} else {
|
} else {
|
||||||
CharSequence text = "No app found to open URL";
|
Toast toast = Toast.makeText(this, getString(R.string.no_web_browser), LENGTH_SHORT);
|
||||||
int duration = Toast.LENGTH_SHORT;
|
|
||||||
Toast toast = Toast.makeText(this, text, duration);
|
|
||||||
toast.show();
|
toast.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ import fr.free.nrw.commons.location.LatLng;
|
||||||
import fr.free.nrw.commons.ui.widget.CompatTextView;
|
import fr.free.nrw.commons.ui.widget.CompatTextView;
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
|
import static android.widget.Toast.LENGTH_SHORT;
|
||||||
|
|
||||||
public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
||||||
|
|
||||||
private boolean editable;
|
private boolean editable;
|
||||||
|
|
@ -309,9 +311,7 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
||||||
if(viewIntent.resolveActivity(getActivity().getPackageManager()) != null){
|
if(viewIntent.resolveActivity(getActivity().getPackageManager()) != null){
|
||||||
startActivity(viewIntent);
|
startActivity(viewIntent);
|
||||||
} else {
|
} else {
|
||||||
CharSequence text = "No app found to open URL";
|
Toast toast = Toast.makeText(getContext(), getString(R.string.no_web_browser), LENGTH_SHORT);
|
||||||
int duration = Toast.LENGTH_SHORT;
|
|
||||||
Toast toast = Toast.makeText(getContext(), text, duration);
|
|
||||||
toast.show();
|
toast.show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -397,10 +397,7 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
||||||
if(browser.resolveActivity(getActivity().getPackageManager()) != null){
|
if(browser.resolveActivity(getActivity().getPackageManager()) != null){
|
||||||
startActivity(browser);
|
startActivity(browser);
|
||||||
} else {
|
} else {
|
||||||
CharSequence text = "No app found to open URL";
|
Toast toast = Toast.makeText(getContext(), getString(R.string.no_web_browser), LENGTH_SHORT);
|
||||||
int duration = Toast.LENGTH_SHORT;
|
|
||||||
|
|
||||||
Toast toast = Toast.makeText(getContext(), text, duration);
|
|
||||||
toast.show();
|
toast.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||||
import static android.content.Context.DOWNLOAD_SERVICE;
|
import static android.content.Context.DOWNLOAD_SERVICE;
|
||||||
import static android.content.Intent.ACTION_VIEW;
|
import static android.content.Intent.ACTION_VIEW;
|
||||||
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||||
|
import static android.widget.Toast.LENGTH_SHORT;
|
||||||
|
|
||||||
public class MediaDetailPagerFragment extends CommonsDaggerSupportFragment implements ViewPager.OnPageChangeListener {
|
public class MediaDetailPagerFragment extends CommonsDaggerSupportFragment implements ViewPager.OnPageChangeListener {
|
||||||
|
|
||||||
|
|
@ -123,10 +124,7 @@ public class MediaDetailPagerFragment extends CommonsDaggerSupportFragment imple
|
||||||
if(viewIntent.resolveActivity(getActivity().getPackageManager()) != null){
|
if(viewIntent.resolveActivity(getActivity().getPackageManager()) != null){
|
||||||
startActivity(viewIntent);
|
startActivity(viewIntent);
|
||||||
} else {
|
} else {
|
||||||
CharSequence text = "No app found to open URL";
|
Toast toast = Toast.makeText(getContext(), getString(R.string.no_web_browser), LENGTH_SHORT);
|
||||||
int duration = Toast.LENGTH_SHORT;
|
|
||||||
|
|
||||||
Toast toast = Toast.makeText(getContext(), text, duration);
|
|
||||||
toast.show();
|
toast.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
|
import static android.widget.Toast.LENGTH_SHORT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by root on 18.12.2017.
|
* Created by root on 18.12.2017.
|
||||||
*/
|
*/
|
||||||
|
|
@ -65,22 +67,17 @@ public class NotificationActivity extends NavigationBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleUrl(String url) {
|
private void handleUrl(String url) {
|
||||||
|
|
||||||
if (url == null || url.equals("")) {
|
if (url == null || url.equals("")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Intent browser = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
Intent browser = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
//check if web browser available
|
//check if web browser available
|
||||||
if(browser.resolveActivity(this.getPackageManager()) != null){
|
if(browser.resolveActivity(this.getPackageManager()) != null){
|
||||||
startActivity(browser);
|
startActivity(browser);
|
||||||
} else {
|
} else {
|
||||||
CharSequence text = "No app found to open URL";
|
Toast toast = Toast.makeText(this, getString(R.string.no_web_browser), LENGTH_SHORT);
|
||||||
int duration = Toast.LENGTH_SHORT;
|
|
||||||
Toast toast = Toast.makeText(this, text, duration);
|
|
||||||
toast.show();
|
toast.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAdapter(List<Notification> notificationList) {
|
private void setAdapter(List<Notification> notificationList) {
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@
|
||||||
<string name="send_log_file">Send log file</string>
|
<string name="send_log_file">Send log file</string>
|
||||||
<string name="send_log_file_description">Send log file to developers via email</string>
|
<string name="send_log_file_description">Send log file to developers via email</string>
|
||||||
<string name="login_to_your_account">Login to your account</string>
|
<string name="login_to_your_account">Login to your account</string>
|
||||||
<string name="error_null_url">URL not found</string>
|
<string name="no_web_browser">No app found to open URL</string>
|
||||||
|
|
||||||
<string name="nearby_location_has_not_changed">Location has not changed.</string>
|
<string name="nearby_location_has_not_changed">Location has not changed.</string>
|
||||||
<string name="nearby_location_not_available">Location not available.</string>
|
<string name="nearby_location_not_available">Location not available.</string>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue