fixed crash, removed unused resources
Signed-off-by: nuclearfog <hatespirit666@gmail.com>
This commit is contained in:
parent
c88c065348
commit
dd21dbb9d9
@ -145,10 +145,10 @@ public abstract class MediaActivity extends AppCompatActivity implements Locatio
|
|||||||
}
|
}
|
||||||
// location permission granted
|
// location permission granted
|
||||||
else if (PERMISSIONS[1][0].equals(permissions[0])) {
|
else if (PERMISSIONS[1][0].equals(permissions[0])) {
|
||||||
getLocation();
|
getLocation(false);
|
||||||
}
|
}
|
||||||
// Write storage permissions granted
|
// Write storage permissions granted
|
||||||
else if ((PERMISSIONS[2][0].equals(permissions[0]))) {
|
else if (PERMISSIONS[2][0].equals(permissions[0])) {
|
||||||
if (grantResults[0] == PERMISSION_GRANTED) {
|
if (grantResults[0] == PERMISSION_GRANTED) {
|
||||||
saveImage();
|
saveImage();
|
||||||
}
|
}
|
||||||
@ -256,19 +256,22 @@ public abstract class MediaActivity extends AppCompatActivity implements Locatio
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Ask for GPS location
|
* Ask for GPS location
|
||||||
|
*
|
||||||
|
* @param ask set true to ask for permission
|
||||||
*/
|
*/
|
||||||
protected void getLocation() {
|
protected void getLocation(boolean ask) {
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M || checkSelfPermission(PERMISSIONS[1][0]) == PERMISSION_GRANTED) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M || checkSelfPermission(PERMISSIONS[1][0]) == PERMISSION_GRANTED) {
|
||||||
LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
||||||
if (locationManager != null && locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
|
if (locationManager != null && locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
|
||||||
locationManager.requestSingleUpdate(LocationManager.GPS_PROVIDER, this, null);
|
locationManager.requestSingleUpdate(LocationManager.GPS_PROVIDER, this, null);
|
||||||
locationPending = true;
|
locationPending = true;
|
||||||
} else {
|
return;
|
||||||
onAttachLocation(null);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else if (ask) {
|
||||||
requestPermissions(PERMISSIONS[1], REQ_CHECK_PERM);
|
requestPermissions(PERMISSIONS[1], REQ_CHECK_PERM);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
onAttachLocation(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -347,6 +350,7 @@ public abstract class MediaActivity extends AppCompatActivity implements Locatio
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* called when location information was successfully fetched
|
* called when location information was successfully fetched
|
||||||
|
* it isn't safe to update views over this method
|
||||||
*
|
*
|
||||||
* @param location location information
|
* @param location location information
|
||||||
*/
|
*/
|
||||||
|
@ -133,6 +133,19 @@ public class TweetEditor extends MediaActivity implements OnClickListener, OnPro
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
if (isLocating()) {
|
||||||
|
locationPending.setVisibility(VISIBLE);
|
||||||
|
locationBtn.setVisibility(INVISIBLE);
|
||||||
|
} else {
|
||||||
|
locationPending.setVisibility(INVISIBLE);
|
||||||
|
locationBtn.setVisibility(VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
if (uploaderAsync != null && uploaderAsync.getStatus() == RUNNING)
|
if (uploaderAsync != null && uploaderAsync.getStatus() == RUNNING)
|
||||||
@ -197,7 +210,7 @@ public class TweetEditor extends MediaActivity implements OnClickListener, OnPro
|
|||||||
else if (v.getId() == R.id.tweet_add_location) {
|
else if (v.getId() == R.id.tweet_add_location) {
|
||||||
locationPending.setVisibility(VISIBLE);
|
locationPending.setVisibility(VISIBLE);
|
||||||
locationBtn.setVisibility(INVISIBLE);
|
locationBtn.setVisibility(INVISIBLE);
|
||||||
getLocation();
|
getLocation(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,8 +222,6 @@ public class TweetEditor extends MediaActivity implements OnClickListener, OnPro
|
|||||||
} else {
|
} else {
|
||||||
Toast.makeText(this, R.string.error_gps, LENGTH_LONG).show();
|
Toast.makeText(this, R.string.error_gps, LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
locationPending.setVisibility(INVISIBLE);
|
|
||||||
locationBtn.setVisibility(VISIBLE);
|
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,4 @@
|
|||||||
<color name="half_transparent">#40000000</color>
|
<color name="half_transparent">#40000000</color>
|
||||||
<color name="background">#80000000</color>
|
<color name="background">#80000000</color>
|
||||||
<color name="bright_transparent">#afffffff</color>
|
<color name="bright_transparent">#afffffff</color>
|
||||||
<color name="positive_button">#ffff4000</color>
|
|
||||||
<color name="negative_button">#ff0040ff</color>
|
|
||||||
</resources>
|
</resources>
|
@ -118,6 +118,10 @@
|
|||||||
<string name="settings_fv_icon_color">Favorite</string>
|
<string name="settings_fv_icon_color">Favorite</string>
|
||||||
<string name="settings_follow_req_color">Request icon</string>
|
<string name="settings_follow_req_color">Request icon</string>
|
||||||
<string name="settings_follow_color">Follow icon</string>
|
<string name="settings_follow_color">Follow icon</string>
|
||||||
|
<string name="account_page" translatable="false">Accounts</string>
|
||||||
|
<string name="confirm_remove_account">Remove account from list?</string>
|
||||||
|
<string name="account_user_id_prefix" translatable="false">User ID:</string>
|
||||||
|
<string name="account_user_unnamed">\'unnamed\'</string>
|
||||||
|
|
||||||
<!-- toast messages to inform user -->
|
<!-- toast messages to inform user -->
|
||||||
<string name="info_user_removed">User removed from list</string>
|
<string name="info_user_removed">User removed from list</string>
|
||||||
@ -227,6 +231,8 @@
|
|||||||
<string name="menu_hint_mute_user">enter @name to mute</string>
|
<string name="menu_hint_mute_user">enter @name to mute</string>
|
||||||
<string name="menu_hint_block_user">enter @name to block</string>
|
<string name="menu_hint_block_user">enter @name to block</string>
|
||||||
<string name="menu_refresh_exclude">refresh exclude list</string>
|
<string name="menu_refresh_exclude">refresh exclude list</string>
|
||||||
|
<string name="menu_select_account">select account</string>
|
||||||
|
<string name="menu_add_account">add account</string>
|
||||||
|
|
||||||
<!--dialog strings-->
|
<!--dialog strings-->
|
||||||
<string name="dialog_button_yes">Yes</string>
|
<string name="dialog_button_yes">Yes</string>
|
||||||
@ -235,11 +241,5 @@
|
|||||||
<string name="dialog_button_ok">OK</string>
|
<string name="dialog_button_ok">OK</string>
|
||||||
<string name="dialog_link_image_preview">Link preview image</string>
|
<string name="dialog_link_image_preview">Link preview image</string>
|
||||||
<string name="dialog_link_close">close link preview</string>
|
<string name="dialog_link_close">close link preview</string>
|
||||||
<string name="account_page" translatable="false">Accounts</string>
|
|
||||||
<string name="confirm_remove_account">Remove account from list?</string>
|
|
||||||
<string name="menu_select_account">select account</string>
|
|
||||||
<string name="menu_add_account">add account</string>
|
|
||||||
<string name="account_user_id_prefix" translatable="false">User ID:</string>
|
|
||||||
<string name="account_user_unnamed">\'unnamed\'</string>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user