Removed search button on main tab, it was redundant, added Exit button. Removed Help and Settings from remaining tabs. Start redesign of the Download tab

This commit is contained in:
Joshua Bahnsen 2012-05-29 18:11:58 -07:00
parent feca33c9ac
commit 97890e8929
9 changed files with 330 additions and 385 deletions

View File

@ -194,7 +194,8 @@
a:id="@+id/download_album_art_layout" a:id="@+id/download_album_art_layout"
a:layout_width="fill_parent" a:layout_width="fill_parent"
a:layout_height="fill_parent" a:layout_height="fill_parent"
a:background="@drawable/album_art_background"> a:background="@drawable/pinstripe_tile" >
<ImageView <ImageView
a:id="@+id/download_album_art_image" a:id="@+id/download_album_art_image"
a:layout_width="wrap_content" a:layout_width="wrap_content"

View File

@ -12,11 +12,11 @@
<RelativeLayout <RelativeLayout
a:id="@+id/download_album_art_layout" a:id="@+id/download_album_art_layout"
a:orientation="vertical"
a:layout_width="fill_parent" a:layout_width="fill_parent"
a:layout_height="fill_parent" a:layout_height="fill_parent"
a:layout_weight="1" a:layout_weight="1"
a:background="@drawable/album_art_background"> a:background="@drawable/pinstripe_tile"
a:orientation="vertical" >
<ImageButton <ImageButton
a:id="@+id/download_repeat" a:id="@+id/download_repeat"

View File

@ -63,7 +63,7 @@
a:padding="5dp" a:padding="5dp"
a:scaleType="center" a:scaleType="center"
a:showAsAction="ifRoom|withText" a:showAsAction="ifRoom|withText"
a:src="@drawable/ic_menu_settings" /> a:src="@drawable/ic_menu_exit" />
<ImageButton <ImageButton
a:id="@+id/action_button_1" a:id="@+id/action_button_1"
@ -75,7 +75,7 @@
a:padding="5dp" a:padding="5dp"
a:scaleType="center" a:scaleType="center"
a:showAsAction="ifRoom|withText" a:showAsAction="ifRoom|withText"
a:src="@drawable/ic_menu_search" /> a:src="@drawable/ic_menu_shuffle" />
<ImageButton <ImageButton
a:id="@+id/action_button_2" a:id="@+id/action_button_2"
@ -87,6 +87,6 @@
a:padding="5dp" a:padding="5dp"
a:scaleType="center" a:scaleType="center"
a:showAsAction="ifRoom|withText" a:showAsAction="ifRoom|withText"
a:src="@drawable/ic_menu_shuffle" /> a:src="@drawable/ic_menu_settings" />
</RelativeLayout> </RelativeLayout>

View File

@ -118,20 +118,8 @@ public class MainActivity extends SubsonicTabActivity {
// Title: Subsonic // Title: Subsonic
setTitle(R.string.common_appname); setTitle(R.string.common_appname);
// Button 1: search // Button 1: shuffle
ImageButton actionSearchButton = (ImageButton)findViewById(R.id.action_button_1); ImageButton actionShuffleButton = (ImageButton)findViewById(R.id.action_button_1);
actionSearchButton.setImageResource(R.drawable.ic_menu_search);
actionSearchButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, SearchActivity.class);
intent.putExtra(Constants.INTENT_EXTRA_REQUEST_SEARCH, true);
Util.startActivityWithoutTransition(MainActivity.this, intent);
}
});
// Button 2: shuffle
ImageButton actionShuffleButton = (ImageButton)findViewById(R.id.action_button_2);
actionShuffleButton.setImageResource(R.drawable.ic_menu_shuffle); actionShuffleButton.setImageResource(R.drawable.ic_menu_shuffle);
actionShuffleButton.setOnClickListener(new View.OnClickListener() { actionShuffleButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -142,6 +130,16 @@ public class MainActivity extends SubsonicTabActivity {
} }
}); });
// Button 2: settings
ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_2);
actionSettingsButton.setImageResource(R.drawable.ic_menu_settings);
actionSettingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(MainActivity.this, SettingsActivity.class));
}
});
// Button 3: help // Button 3: help
ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3); ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3);
actionHelpButton.setImageResource(R.drawable.ic_menu_help); actionHelpButton.setImageResource(R.drawable.ic_menu_help);
@ -152,13 +150,13 @@ public class MainActivity extends SubsonicTabActivity {
} }
}); });
// Button 4: settings // Button 4: exit
ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_4); ImageButton actionSearchButton = (ImageButton)findViewById(R.id.action_button_4);
actionSettingsButton.setImageResource(R.drawable.ic_menu_settings); actionSearchButton.setImageResource(R.drawable.ic_menu_exit);
actionSettingsButton.setOnClickListener(new View.OnClickListener() { actionSearchButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
startActivity(new Intent(MainActivity.this, SettingsActivity.class)); exit();
} }
}); });

View File

@ -138,8 +138,14 @@ public class SearchActivity extends SubsonicTabActivity {
// Button 1: gone // Button 1: gone
findViewById(R.id.action_button_1).setVisibility(View.GONE); findViewById(R.id.action_button_1).setVisibility(View.GONE);
// Button 2: search // Button 2: gone
final ImageButton actionSearchButton = (ImageButton)findViewById(R.id.action_button_2); findViewById(R.id.action_button_2).setVisibility(View.GONE);
// Button 3: gone
findViewById(R.id.action_button_3).setVisibility(View.GONE);
// Button 4: search
final ImageButton actionSearchButton = (ImageButton)findViewById(R.id.action_button_4);
actionSearchButton.setImageResource(R.drawable.ic_menu_search); actionSearchButton.setImageResource(R.drawable.ic_menu_search);
actionSearchButton.setOnClickListener(new View.OnClickListener() { actionSearchButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -148,26 +154,6 @@ public class SearchActivity extends SubsonicTabActivity {
} }
}); });
// Button 3: help
ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3);
actionHelpButton.setImageResource(R.drawable.ic_menu_help);
actionHelpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(SearchActivity.this, HelpActivity.class));
}
});
// Button 4: settings
ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_4);
actionSettingsButton.setImageResource(R.drawable.ic_menu_settings);
actionSettingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(SearchActivity.this, SettingsActivity.class));
}
});
onNewIntent(getIntent()); onNewIntent(getIntent());
} }

View File

@ -170,8 +170,14 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
getMusicDirectory(id, name); getMusicDirectory(id, name);
} }
// Button 1: play all // Button 1: gone
playAllButton = (ImageButton) findViewById(R.id.action_button_1); findViewById(R.id.action_button_1).setVisibility(View.GONE);
// Button 2: gone
findViewById(R.id.action_button_2).setVisibility(View.GONE);
// Button 3: play all
playAllButton = (ImageButton) findViewById(R.id.action_button_3);
playAllButton.setImageResource(R.drawable.ic_menu_play_all); playAllButton.setImageResource(R.drawable.ic_menu_play_all);
playAllButton.setVisibility(View.GONE); playAllButton.setVisibility(View.GONE);
playAllButton.setOnClickListener(new View.OnClickListener() { playAllButton.setOnClickListener(new View.OnClickListener() {
@ -181,8 +187,8 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
} }
}); });
// Button 2: refresh // Button 4: refresh
ImageButton refreshButton = (ImageButton) findViewById(R.id.action_button_2); ImageButton refreshButton = (ImageButton) findViewById(R.id.action_button_4);
refreshButton.setImageResource(R.drawable.ic_menu_refresh); refreshButton.setImageResource(R.drawable.ic_menu_refresh);
refreshButton.setOnClickListener(new View.OnClickListener() { refreshButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -190,26 +196,6 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
refresh(); refresh();
} }
}); });
// Button 3: help
ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3);
actionHelpButton.setImageResource(R.drawable.ic_menu_help);
actionHelpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(SelectAlbumActivity.this, HelpActivity.class));
}
});
// Button 4: settings
ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_4);
actionSettingsButton.setImageResource(R.drawable.ic_menu_settings);
actionSettingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(SelectAlbumActivity.this, SettingsActivity.class));
}
});
} }
private void playAll() { private void playAll() {

View File

@ -76,8 +76,14 @@ public class SelectArtistActivity extends SubsonicTabActivity implements Adapter
setTitle(Util.isOffline(this) ? R.string.music_library_label_offline : R.string.music_library_label); setTitle(Util.isOffline(this) ? R.string.music_library_label_offline : R.string.music_library_label);
// Button 1: shuffle // Button 1: gone
ImageButton shuffleButton = (ImageButton) findViewById(R.id.action_button_1); findViewById(R.id.action_button_1).setVisibility(View.GONE);
// Button 2: gone
findViewById(R.id.action_button_2).setVisibility(View.GONE);
// Button 3: shuffle
ImageButton shuffleButton = (ImageButton) findViewById(R.id.action_button_3);
shuffleButton.setImageResource(R.drawable.ic_menu_shuffle); shuffleButton.setImageResource(R.drawable.ic_menu_shuffle);
shuffleButton.setOnClickListener(new View.OnClickListener() { shuffleButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -88,8 +94,8 @@ public class SelectArtistActivity extends SubsonicTabActivity implements Adapter
} }
}); });
// Button 2: refresh // Button 4: refresh
ImageButton refreshButton = (ImageButton) findViewById(R.id.action_button_2); ImageButton refreshButton = (ImageButton) findViewById(R.id.action_button_4);
refreshButton.setImageResource(R.drawable.ic_menu_refresh); refreshButton.setImageResource(R.drawable.ic_menu_refresh);
refreshButton.setOnClickListener(new View.OnClickListener() { refreshButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -98,25 +104,7 @@ public class SelectArtistActivity extends SubsonicTabActivity implements Adapter
} }
}); });
// Button 3: help
ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3);
actionHelpButton.setImageResource(R.drawable.ic_menu_help);
actionHelpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(SelectArtistActivity.this, HelpActivity.class));
}
});
// Button 4: settings
ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_4);
actionSettingsButton.setImageResource(R.drawable.ic_menu_settings);
actionSettingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(SelectArtistActivity.this, SettingsActivity.class));
}
});
musicFolders = null; musicFolders = null;
load(); load();

View File

@ -61,11 +61,16 @@ public class SelectPlaylistActivity extends SubsonicTabActivity implements Adapt
setTitle(R.string.playlist_label); setTitle(R.string.playlist_label);
// Button 1: gone // Button 1: gone
ImageButton searchButton = (ImageButton)findViewById(R.id.action_button_1); findViewById(R.id.action_button_1).setVisibility(View.GONE);
searchButton.setVisibility(View.GONE);
// Button 2: refresh // Button 2: gone
ImageButton refreshButton = (ImageButton) findViewById(R.id.action_button_2); findViewById(R.id.action_button_2).setVisibility(View.GONE);
// Button 3: gone
findViewById(R.id.action_button_3).setVisibility(View.GONE);
// Button 4: refresh
ImageButton refreshButton = (ImageButton) findViewById(R.id.action_button_4);
refreshButton.setImageResource(R.drawable.ic_menu_refresh); refreshButton.setImageResource(R.drawable.ic_menu_refresh);
refreshButton.setOnClickListener(new View.OnClickListener() { refreshButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -74,26 +79,6 @@ public class SelectPlaylistActivity extends SubsonicTabActivity implements Adapt
} }
}); });
// Button 3: help
ImageButton actionHelpButton = (ImageButton)findViewById(R.id.action_button_3);
actionHelpButton.setImageResource(R.drawable.ic_menu_help);
actionHelpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(SelectPlaylistActivity.this, HelpActivity.class));
}
});
// Button 4: settings
ImageButton actionSettingsButton = (ImageButton)findViewById(R.id.action_button_4);
actionSettingsButton.setImageResource(R.drawable.ic_menu_settings);
actionSettingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(SelectPlaylistActivity.this, SettingsActivity.class));
}
});
load(); load();
} }

View File

@ -66,7 +66,8 @@ public class ImageLoader implements Runnable {
// Determine the density-dependent image sizes. // Determine the density-dependent image sizes.
imageSizeDefault = context.getResources().getDrawable(R.drawable.unknown_album).getIntrinsicHeight(); imageSizeDefault = context.getResources().getDrawable(R.drawable.unknown_album).getIntrinsicHeight();
DisplayMetrics metrics = context.getResources().getDisplayMetrics(); DisplayMetrics metrics = context.getResources().getDisplayMetrics();
imageSizeLarge = (int) Math.round(Math.min(metrics.widthPixels, metrics.heightPixels) * 0.6); /*imageSizeLarge = (int) Math.round(Math.min(metrics.widthPixels, metrics.heightPixels) * 0.6);*/
imageSizeLarge = (int) Math.round(Math.min(metrics.widthPixels, metrics.heightPixels));
for (int i = 0; i < CONCURRENCY; i++) { for (int i = 0; i < CONCURRENCY; i++) {
new Thread(this, "ImageLoader").start(); new Thread(this, "ImageLoader").start();
@ -98,7 +99,7 @@ public class ImageLoader implements Runnable {
if (!large) { if (!large) {
setUnknownImage(view, large); setUnknownImage(view, large);
} }
queue.offer(new Task(view, entry, size, large, large, crossfade)); queue.offer(new Task(view, entry, size, false, large, crossfade));
} }
private String getKey(String coverArtId, int size) { private String getKey(String coverArtId, int size) {