Browse files

cleanup

  • Loading branch information...
1 parent fe9ff7b commit e38a8037d9dc427ecbfcd31e0a943b88299067b1 @romanbb committed Aug 16, 2012
View
7 src/com/aokp/swagpapers/Preview.java
@@ -93,9 +93,7 @@ public void onLoaded(ImageView imageView, Drawable loadedDrawable, String url,
File f = new File(WallpaperActivity.getSvDir(getApplicationContext()));
Log.i(TAG, "Check for external SD: " + f.getAbsolutePath());
if (f.isDirectory() && f.exists()) {
- Log.i(TAG, "FNV folder exists");
} else {
- Log.i(TAG, "FNV folder does not exist. Creating...");
f.mkdirs();
}
@@ -107,7 +105,6 @@ public void onClick(View v) {
s.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
- // TODO Auto-generated method stub
new StoreFileAsync().execute(link);
}
});
@@ -179,8 +176,6 @@ protected Dialog onCreateDialog(int id) {
}
}
- // Downloads the wallpaper in Async with a dialog
- // This one just sets the wallpaper
class DownloadFileAsync extends AsyncTask<String, String, String> {
@SuppressWarnings("deprecation")
@@ -219,8 +214,6 @@ protected void onProgressUpdate(String... progress) {
}
- // Downloads the wallpaper in Async with a dialog
- // This one saves the wallpaper
class StoreFileAsync extends AsyncTask<String, String, String> {
@SuppressWarnings("deprecation")
View
77 src/com/aokp/swagpapers/Vote.java
@@ -1,77 +0,0 @@
-package com.aokp.swagpapers;
-
-import android.app.ActionBar;
-import android.app.AlertDialog;
-import android.content.DialogInterface;
-import android.content.SharedPreferences;
-import android.os.Bundle;
-import android.view.KeyEvent;
-import android.view.Menu;
-import android.view.MenuItem;
-
-public class Vote extends WallpaperActivity {
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_vote);
-
- ActionBar bar = getActionBar();
- bar.setTitle(R.string.wars);
- bar.setDisplayHomeAsUpEnabled(true);
-
- SharedPreferences s = getPreferences(MODE_PRIVATE);
- SharedPreferences.Editor e = s.edit();
- Boolean run = s.getBoolean("firstRun", false);
- if (run != true) {
- aboutDialog();
- e.putBoolean("firstRun", true);
- e.commit();
- }
- }
-
- public void aboutDialog() {
- AlertDialog.Builder b = new AlertDialog.Builder(this);
- b.setTitle(R.string.wars);
- b.setMessage("Choose the next wallpaper to be added to FNV Wallpapers.\n\n" +
- "Every week, two wallpapers will be selected. All you have to do is choose which one you want to see in FNV Wallpapers!\n\n" +
- "After four new wallpapers have been choosen, they will appear in the app.");
- b.setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() {
-
- public void onClick(DialogInterface dialog, int which) {
- // TODO Auto-generated method stub
- dialog.cancel();
- }
- });
- b.create();
- b.show();
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.activity_vote, menu);
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- // Handle item selection
- switch (item.getItemId()) {
- case android.R.id.home:
- finish();
- return true;
- case R.id.about:
- aboutDialog();
- return true;
- default:
- return super.onOptionsItemSelected(item);
- }
- }
-
- @Override
- public boolean onKeyDown (int keyCode, KeyEvent event) {
- if (keyCode == KeyEvent.KEYCODE_BACK) {
- finish();
- }
- return super.onKeyDown(keyCode, event);
- }
-}
View
5 src/com/aokp/swagpapers/WallpaperActivity.java
@@ -249,19 +249,14 @@ protected Button getPreviousButton() {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- inflater.inflate(R.menu.activity_wallpaper, menu);
super.onCreateOptionsMenu(menu, inflater);
}
public boolean onOptionsItemSelected(MenuItem item) {
- // Handle item selection
switch (item.getItemId()) {
case R.id.jump:
jumpTo();
return true;
- case R.id.vote:
- Intent v = new Intent(mActivity, Vote.class);
- startActivity(v);
default:
return super.onOptionsItemSelected(item);
}

0 comments on commit e38a803

Please sign in to comment.