Permalink
Browse files

Cleanup of unused files and styles

  • Loading branch information...
1 parent a982dcf commit 14fd8db3c4e731a3ab4a7848ba7cdd53c30031fd @NewProggie committed Feb 10, 2012
View
BIN res/drawable-hdpi/done_badge.png
Deleted file not rendered
View
BIN res/drawable-ldpi/done_badge.png
Deleted file not rendered
View
BIN res/drawable-mdpi/done_badge.png
Deleted file not rendered
View
9 res/drawable/actionbar_background.xml
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<shape
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle">
- <gradient
- android:startColor="@color/actionbar_grad_start"
- android:endColor="@color/actionbar_grad_end"
- android:angle="270" />
-</shape>
View
5 res/drawable/actionbar_button_selector.xml
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true" android:drawable="@color/orange" />
- <item android:drawable="@drawable/actionbar_background" />
-</selector>
View
4 res/layout/actionbar.xml
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <LinearLayout android:id="@+id/actionbar" style="@style/ActionBar" />
-</merge>
View
20 res/layout/base_activity.xml
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/root_container"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <include layout="@layout/actionbar" />
- <FrameLayout
- android:id="@+id/layout_container"
- android:layout_weight="1"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <ProgressBar
- android:id="@+id/loading_spinner"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:layout_gravity="center"/>
- </FrameLayout>
-</LinearLayout>
View
6 res/values/attrs.xml
@@ -1,8 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <declare-styleable name="AppTheme">
- <attr name="actionbarSeparatorStyle" format="reference" />
- <attr name="actionbarTextStyle" format="reference" />
- <attr name="actionbarButtonStyle" format="reference" />
- </declare-styleable>
+
</resources>
View
40 res/values/styles.xml
@@ -1,46 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="ApplicationStyle" parent="@android:style/Theme.NoTitleBar">
- <item name="actionbarSeparatorStyle">@style/ActionBarSeparator</item>
- <item name="actionbarTextStyle">@style/ActionBarText</item>
- <item name="actionbarButtonStyle">@style/ActionBarButton</item>
</style>
- <style name="ActionBar">
- <item name="android:layout_width">fill_parent</item>
- <item name="android:layout_height">@dimen/actionbar_height</item>
- <item name="android:gravity">center_vertical</item>
- <item name="android:orientation">horizontal</item>
- <item name="android:background">@drawable/actionbar_background</item>
- </style>
- <style name="ActionBarButton">
- <item name="android:layout_width">@dimen/actionbar_height</item>
- <item name="android:layout_height">fill_parent</item>
- <item name="android:scaleType">center</item>
- <item name="android:background">@drawable/actionbar_button_selector</item>
- </style>
- <style name="ActionBarSeparator">
- <item name="android:layout_width">2px</item>
- <item name="android:layout_height">fill_parent</item>
- <item name="android:background">@drawable/actionbar_separator</item>
- </style>
- <style name="ActionBarText">
- <item name="android:id">@+id/actionbar_text</item>
- <item name="android:layout_width">0dp</item>
- <item name="android:layout_height">fill_parent</item>
- <item name="android:layout_weight">1</item>
- <item name="android:gravity">center_vertical</item>
- <item name="android:textSize">@dimen/text_size_large</item>
- <item name="android:paddingLeft">12dp</item>
- <item name="android:paddingRight">12dp</item>
- <item name="android:textStyle">bold</item>
- <item name="android:textColor">@color/actionbar_text</item>
- <item name="android:shadowColor">@color/actionbar_text_shadow</item>
- <item name="android:shadowDx">0</item>
- <item name="android:shadowDy">1</item>
- <item name="android:shadowRadius">0.00001</item>
- <item name="android:singleLine">true</item>
- <item name="android:ellipsize">end</item>
- </style>
+
<style name="ShadowedWhiteText">
<item name="android:textColor">@color/white</item>
<item name="android:shadowColor">@color/black</item>
View
266 src/org/sparkleshare/android/ui/BaseActivity.java
@@ -1,266 +0,0 @@
-package org.sparkleshare.android.ui;
-
-import org.sparkleshare.android.BrowsingActivity;
-import org.sparkleshare.android.R;
-import org.sparkleshare.android.SettingsActivity;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.os.Bundle;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageButton;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-
-/**
- * Implements common functionality across the different app activities such as the actionbar. Ths class
- * mustn't be used directly, instead activities should inherit from
- *
- * @author kai
- *
- */
-public class BaseActivity extends Activity {
-
- private ViewGroup content;
- private boolean optionsMenuEnabled;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- super.setContentView(R.layout.base_activity);
- content = (ViewGroup) super.findViewById(R.id.layout_container);
- optionsMenuEnabled = true;
- }
-
- @Override
- protected void onStart() {
- super.onStart();
- }
-
- @Override
- protected void onStop() {
- super.onStop();
- }
-
- @Override
- protected void onRestart() {
- super.onRestart();
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- }
-
- @Override
- public void setContentView(int layoutResID) {
- content.removeAllViews();
- getLayoutInflater().inflate(layoutResID, content);
- }
-
- @Override
- public void setContentView(View view) {
- content.removeAllViews();
- content.addView(view);
- }
-
- @Override
- public View findViewById(int id) {
- return content.findViewById(id);
- }
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
- }
-
- /**
- * Sets up the actionbar with the given title and the color. If the title is
- * null, then the app name will be shown instead of the title. Otherwise, a
- * home button and the given title are visible. If the color is null, then
- * the default color is visible.
- *
- * @param title title of actionbar
- * @param color color of title
- */
- protected void setupActionBar(CharSequence title, int color) {
- final ViewGroup actionBar = getActionBar();
- if (actionBar == null) {
- return;
- }
-
- LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.FILL_PARENT);
- layoutParams.weight = 1;
-
- View.OnClickListener homeClickListener = new View.OnClickListener() {
-
- @Override
- public void onClick(View v) {
- backToMain();
- }
- };
-
- if (title != null) {
- // adding home button
- if (title.equals("SparkleShare")) {
- addActionButton(R.drawable.ic_action_overview, R.string.home, homeClickListener, true);
- } else {
- addActionButton(R.drawable.ic_action_overview, R.string.home, homeClickListener, true);
- }
-
- // adding title text
- TextView titleText = new TextView(this, null, R.attr.actionbarTextStyle);
- titleText.setLayoutParams(layoutParams);
- titleText.setText(title);
- actionBar.addView(titleText);
- } else {
- // adding app name
- TextView appName = new TextView(this, null, R.attr.actionbarTextStyle);
- appName.setText(getString(R.string.app_name));
- actionBar.addView(appName);
-
- // adding layout for aligning items to the right
- View dummy = new View(this);
- dummy.setLayoutParams(layoutParams);
- actionBar.addView(dummy);
- }
-
- }
-
- protected void setupActionBarWithoutHomeButton(CharSequence title, int color) {
- final ViewGroup actionBar = getActionBar();
- if (actionBar == null) {
- return;
- }
-
- LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.FILL_PARENT);
- layoutParams.weight = 1;
-
- if (title != null) {
- // adding title text
- TextView titleText = new TextView(this, null, R.attr.actionbarTextStyle);
- titleText.setLayoutParams(layoutParams);
- titleText.setText(title);
- actionBar.addView(titleText);
- } else {
- // adding app name
- TextView appName = new TextView(this, null, R.attr.actionbarTextStyle);
- appName.setText(getString(R.string.app_name));
- actionBar.addView(appName);
-
- // adding layout for aligning items to the right
- View dummy = new View(this);
- dummy.setLayoutParams(layoutParams);
- actionBar.addView(dummy);
- }
- }
-
- /**
- * Returns the {@link ViewGroup} for the actionbar. May return null.
- */
- protected ViewGroup getActionBar() {
- return (ViewGroup) super.findViewById(R.id.actionbar);
- }
-
- /**
- * Disables the actionbar.
- */
- protected void disableActionBar() {
- ViewGroup actionBar = (ViewGroup) super.findViewById(R.id.actionbar);
- actionBar.setVisibility(View.GONE);
- }
-
- /**
- * Interface for activities who need to draw action buttons on the action bar
- * @param iconResId ressource identifier for icon
- * @param textResId ressource identifier for text
- * @param clickListener triggered listener when pressing the button
- */
- protected void addNewActionButton(int iconResId, int textResId, View.OnClickListener clickListener) {
- addActionButton(iconResId, textResId, clickListener, false);
- }
-
- /**
- * Adds new action button onto the action bar and takes car of drawing the separator between each buttons on the right place
- * @param iconResId resource identifier for icon
- * @param textResId resource identifier for text
- * @param clickListener triggered listener when pressing the button
- * @param separatorAfter true if there is another button following, else false
- * @return new action button view
- */
- private View addActionButton(int iconResId, int textResId, View.OnClickListener clickListener, boolean separatorAfter) {
- final ViewGroup actionBar = getActionBar();
-
- // button separator
- ImageView separator = new ImageView(getApplicationContext(), null, R.attr.actionbarSeparatorStyle);
- separator.setLayoutParams(new ViewGroup.LayoutParams(2, ViewGroup.LayoutParams.FILL_PARENT));
- separator.setBackgroundDrawable(getResources().getDrawable(R.drawable.actionbar_separator));
-
- // new action button
- ImageButton actionButton = new ImageButton(this, null, R.attr.actionbarButtonStyle);
- actionButton.setImageResource(iconResId);
- actionButton.setContentDescription(this.getResources().getString(textResId));
- actionButton.setOnClickListener(clickListener);
-
- // adding separator properly
- if (!separatorAfter)
- actionBar.addView(separator);
-
- actionBar.addView(actionButton);
-
- if (separatorAfter)
- actionBar.addView(separator);
-
- return actionButton;
- }
-
- /**
- * Starting home activity, returning to
- * {@link MainActivity }.
- */
- private void backToMain() {
- SharedPreferences prefs = SettingsActivity.getSettings(this);
- String serverUrl = prefs.getString("serverUrl", "") + "/api/getFolderList";
-
- Intent intent = new Intent(this, BrowsingActivity.class);
- intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- intent.putExtra("url", serverUrl);
- startActivity(intent);
- }
-
- protected void disableOptionsMenu() {
- optionsMenuEnabled = false;
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- if (optionsMenuEnabled) {
- getMenuInflater().inflate(R.menu.option, menu);
- return super.onCreateOptionsMenu(menu);
- } else {
- return false;
- }
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case R.id.opt_settings:
- Intent settings = new Intent(this, SettingsActivity.class);
- startActivity(settings);
- return true;
- default:
- return super.onOptionsItemSelected(item);
- }
- }
-}
View
1 src/org/sparkleshare/android/ui/FileDetailsFragment.java
@@ -25,6 +25,7 @@
import org.sparkleshare.android.SettingsActivity;
import org.sparkleshare.android.utils.ExternalDirectory;
import org.sparkleshare.android.utils.FakeSocketFactory;
+import org.sparkleshare.android.utils.FormatHelper;
import org.sparkleshare.android.utils.MimetypeChecker;
import android.app.Notification;
View
2 src/org/sparkleshare/android/ui/ListEntryItem.java
@@ -1,5 +1,7 @@
package org.sparkleshare.android.ui;
+import org.sparkleshare.android.utils.FormatHelper;
+
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
View
2 ...sparkleshare/android/ui/FormatHelper.java → ...rkleshare/android/utils/FormatHelper.java
@@ -1,4 +1,4 @@
-package org.sparkleshare.android.ui;
+package org.sparkleshare.android.utils;
public class FormatHelper {

0 comments on commit 14fd8db

Please sign in to comment.