-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh button #11
Refresh button #11
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ | |
import android.view.MenuInflater; | ||
import android.view.MenuItem; | ||
import android.widget.EditText; | ||
import android.widget.Toast; | ||
|
||
import de.arcus.framework.logger.Logger; | ||
import de.arcus.framework.crashhandler.CrashHandler; | ||
|
@@ -328,28 +329,22 @@ public boolean onCreateOptionsMenu(Menu menu) { | |
MenuInflater inflater = getMenuInflater(); | ||
inflater.inflate(R.menu.music_track_list, menu); | ||
|
||
MenuItem itemRefreshLibrary = menu. findItem(R.id.action_refresh); | ||
itemRefreshLibrary.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() | ||
MenuItem itemRefreshLibrary = menu.findItem(R.id.action_refresh); | ||
itemRefreshLibrary.setOnMenuItemClickListener(item -> | ||
{ | ||
@Override | ||
public boolean onMenuItemClick(MenuItem item) | ||
try | ||
{ | ||
try | ||
{ | ||
mPlayMusicManager.realoadDatabase(); | ||
} | ||
catch (NoSuperUserException e) | ||
{ | ||
e.printStackTrace(); | ||
} | ||
catch (CouldNotOpenDatabaseException e) | ||
{ | ||
e.printStackTrace(); | ||
} | ||
mPlayMusicManager.realoadDatabase(); | ||
mPlayMusicManager = null; | ||
loadPlayMusicExporter(); | ||
return true; | ||
Toast.makeText( this, R.string.databasereloaded, Toast.LENGTH_SHORT).show(); | ||
} | ||
catch (NoSuperUserException | CouldNotOpenDatabaseException e) | ||
{ | ||
Toast.makeText( this, R.string.dialog_superuser_access_denied_title, Toast.LENGTH_SHORT).show(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this quite misleading, if the thrown exception is a CouldNotOpenDatabaseException? I would not expect that to be thrown though, I've never seen it. Still, that might be something we should change later on, even though I wouldn't wait with merging the PR because of that. |
||
e.printStackTrace(); | ||
} | ||
return true; | ||
}); | ||
|
||
// Finds the search item and create the search view | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,4 +106,6 @@ | |
<string name="file_handling_category">Dateiverarbeitung</string> | ||
<string name="overwrite_summary">Überschreiben Sie die exportierte Datei immer, auch wenn sie bereits existiert.</string> | ||
<string name="overwrite_title">Bestehende Dateien überschreiben.</string> | ||
<string name="action_refesh">Erfrischen</string> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That sounds weird, someting like "Erneut laden" (enl. load again) would be more fitting I think. |
||
<string name="databasereloaded">Reloaded Musikdatenbank</string> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reloaded is not german, I would suggest "Musikdatenbank neu geladen" or shorter "Datenbank erneuert" |
||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,6 @@ | |
<color name="button_navigation_drawer_active">#11000000</color> | ||
<color name="button_navigation_drawer_text">#88000000</color> | ||
<color name="button_navigation_drawer_text_active">#ef6c00</color> | ||
<color name="white">#ffffffff</color> | ||
<color name="white">#ffffffff</color> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! |
||
<color name="black">#ff000000</color> | ||
</resources> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,5 +146,6 @@ | |
<string name="file_handling_category">File Handling</string> | ||
<string name="overwrite_summary">Always overwrite the exported file, even if it already exists.</string> | ||
<string name="overwrite_title">Overwrite Existing Files</string> | ||
<string name="action_refesh">Refresh</string> | ||
<string name="action_refesh">Refresh</string> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! |
||
<string name="databasereloaded">Music Database Reloaded</string> | ||
</resources> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!