1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-22 12:22:08 +01:00

removed swipeviewfunction from share activities, removed snackbar on menu - exit

This commit is contained in:
scoute-dich 2016-03-23 21:07:53 +01:00
parent 07bb60ee97
commit 1fcafa088f
7 changed files with 13 additions and 61 deletions

View file

@ -10,8 +10,7 @@
android:allowBackup="true" android:allowBackup="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/AppTheme" android:theme="@style/AppTheme" >
android:windowSoftInputMode="adjustResize" >
<activity <activity
android:name=".SplashActivity" android:name=".SplashActivity"
android:launchMode="singleInstance" android:launchMode="singleInstance"

View file

@ -496,15 +496,7 @@ public class MainActivity extends AppCompatActivity
} }
case R.id.action_exit: { case R.id.action_exit: {
Snackbar snackbar = Snackbar moveTaskToBack(true);
.make(swipeView, R.string.confirm_exit, Snackbar.LENGTH_LONG)
.setAction(R.string.yes, new View.OnClickListener() {
@Override
public void onClick(View view) {
moveTaskToBack(true);
}
});
snackbar.show();
} }
break; break;

View file

@ -74,8 +74,7 @@ public class ShareActivity extends MainActivity {
progressBar = (ProgressBar)findViewById(R.id.progressBar); progressBar = (ProgressBar)findViewById(R.id.progressBar);
swipeView = (SwipeRefreshLayout) findViewById(R.id.swipe); swipeView = (SwipeRefreshLayout) findViewById(R.id.swipe);
swipeView.setColorSchemeResources(R.color.colorPrimary, swipeView.setEnabled(false);
R.color.fab_big);
toolbar.setOnClickListener(new View.OnClickListener() { toolbar.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -137,18 +136,6 @@ public class ShareActivity extends MainActivity {
} }
}); });
swipeView.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (Helpers.isOnline(ShareActivity.this)) {
webView.reload();
} else {
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_LONG).show();
swipeView.setRefreshing(false);
}
}
});
/* /*
* WebChromeClient * WebChromeClient
@ -332,14 +319,8 @@ public class ShareActivity extends MainActivity {
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId(); int id = item.getItemId();
if (id == R.id.action_reload) { if (id == R.id.action_exit) {
if (Helpers.isOnline(ShareActivity.this)) { moveTaskToBack(true);
webView.reload();
return true;
} else {
Snackbar.make(getWindow().findViewById(R.id.drawer_layout), R.string.no_internet, Snackbar.LENGTH_LONG).show();
return false;
}
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);

View file

@ -74,8 +74,7 @@ public class ShareActivity2 extends MainActivity {
progressBar = (ProgressBar)findViewById(R.id.progressBar); progressBar = (ProgressBar)findViewById(R.id.progressBar);
swipeView = (SwipeRefreshLayout) findViewById(R.id.swipe); swipeView = (SwipeRefreshLayout) findViewById(R.id.swipe);
swipeView.setColorSchemeResources(R.color.colorPrimary, swipeView.setEnabled(false);
R.color.fab_big);
toolbar.setOnClickListener(new View.OnClickListener() { toolbar.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -137,18 +136,6 @@ public class ShareActivity2 extends MainActivity {
} }
}); });
swipeView.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (Helpers.isOnline(ShareActivity2.this)) {
webView.reload();
} else {
Snackbar.make(swipeView, R.string.no_internet, Snackbar.LENGTH_LONG).show();
swipeView.setRefreshing(false);
}
}
});
/* /*
* WebChromeClient * WebChromeClient
@ -333,14 +320,8 @@ public class ShareActivity2 extends MainActivity {
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId(); int id = item.getItemId();
if (id == R.id.action_reload) { if (id == R.id.action_exit) {
if (Helpers.isOnline(ShareActivity2.this)) { moveTaskToBack(true);
webView.reload();
return true;
} else {
Snackbar.make(getWindow().findViewById(R.id.drawer_layout), R.string.no_internet, Snackbar.LENGTH_SHORT).show();
return false;
}
} }
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);

View file

@ -3,11 +3,10 @@
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"> xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
<item <item
android:id="@+id/action_reload" android:id="@+id/action_exit"
android:icon="@drawable/ic_sync_white_24dp" android:icon="@drawable/ic_sync_white_24dp"
android:title="@string/reload" android:title="@string/exit_app"
android:orderInCategory="109" app:showAsAction="never" />
app:showAsAction="ifRoom" />
<!--<item--> <!--<item-->
<!--android:id="@+id/exit_app"--> <!--android:id="@+id/exit_app"-->

View file

@ -58,7 +58,7 @@
//Dialog //Dialog
<string name="messages">Unterhaltungen</string> <string name="messages">Unterhaltungen</string>
<string name="new_post">Neuer Beitrag</string> <string name="new_post">D* Neuer Beitrag</string>
<string name="notifications">Benachrichtigungen</string> <string name="notifications">Benachrichtigungen</string>
<string name="settings_font">Schriftgröße ändern</string> <string name="settings_font">Schriftgröße ändern</string>
<string name="settings_image">Bilder laden umschalten</string> <string name="settings_image">Bilder laden umschalten</string>

View file

@ -31,7 +31,7 @@
<string name="yes">YES</string> <string name="yes">YES</string>
<string name="no">NO</string> <string name="no">NO</string>
<string name="change_pod_warning">This will erase all cookies and session data. Do you really want to change pods?</string> <string name="change_pod_warning">This will erase all cookies and session data. Do you really want to change pods?</string>
<string name="new_post">New message</string> <string name="new_post">D* New message</string>
<string name="new_post1">D* Text only</string> <string name="new_post1">D* Text only</string>
<string name="new_post2">D* Title and text</string> <string name="new_post2">D* Title and text</string>
<string name="notifications">Notifications</string> <string name="notifications">Notifications</string>