Skip to content

Commit

Permalink
Source formatting fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jush committed Jun 25, 2011
1 parent 59cd58f commit d465cc4
Show file tree
Hide file tree
Showing 13 changed files with 885 additions and 850 deletions.
87 changes: 56 additions & 31 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,35 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- /*******************************************************************************
Copyright: 2011 Android Aalto Community This file is part of SoundFused.
SoundFused is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. SoundFused is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public License
along with SoundFused; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ******************************************************************************/ -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.androidaalto.soundfused" android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<!--
/*******************************************************************************
Copyright: 2011 Android Aalto Community
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:theme="@style/CustomButton">
<activity android:name="BoardActivity" android:label="@string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This file is part of SoundFused.
<activity android:name="AndroidExplorer" android:label="Select file"
android:screenOrientation="landscape">
</activity>
<activity android:name="Preferences" android:label="Preferences"></activity>
<activity android:name="AddColumnPicker" android:label="Add column" android:theme="@android:style/Theme.Dialog"></activity>
</application>
</manifest>
SoundFused is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
SoundFused is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SoundFused; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="org.androidaalto.soundfused"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="7" />
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/CustomButton">
<activity
android:name="BoardActivity"
android:label="@string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="AndroidExplorer"
android:label="Select file"
android:screenOrientation="landscape">
</activity>
<activity
android:name="Preferences"
android:label="Preferences"></activity>
<activity
android:name="AddColumnPicker"
android:label="Add column"
android:theme="@android:style/Theme.Dialog"></activity>
</application>
</manifest>
2 changes: 0 additions & 2 deletions res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="Languages">

<EditTextPreference
android:title="BPM"
android:key="bpm"
android:defaultValue="120">
</EditTextPreference>

</PreferenceCategory>
</PreferenceScreen>
80 changes: 50 additions & 30 deletions src/org/androidaalto/soundfused/AddColumnPicker.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/*******************************************************************************
Copyright: 2011 Android Aalto Community
This file is part of SoundFused.
SoundFused is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
SoundFused is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SoundFused; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/

package org.androidaalto.soundfused;

import org.androidaalto.soundfused.picker.NumberPicker;
Expand All @@ -7,36 +29,34 @@
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;
import android.widget.LinearLayout;

public class AddColumnPicker extends Activity {
NumberPicker np;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Log.e("TEST", "Creating picker");
super.onCreate(savedInstanceState);
setContentView(R.layout.add_columns);
np = (NumberPicker) findViewById(R.id.pref_num_picker);
np.setRange(1, 10);
np.setCurrent(1);
}

@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == 4) {
Bundle b = new Bundle();
Log.e("TEST", "Return " + np.getCurrent());
b.putInt("amount", np.getCurrent());
Intent i = new Intent();
i.putExtras(b);
setResult(1, i);
finish();
return true;
}
// TODO Auto-generated method stub
return super.onKeyUp(keyCode, event);
}
NumberPicker np;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Log.e("TEST", "Creating picker");
super.onCreate(savedInstanceState);
setContentView(R.layout.add_columns);
np = (NumberPicker) findViewById(R.id.pref_num_picker);
np.setRange(1, 10);
np.setCurrent(1);
}

@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == 4) {
Bundle b = new Bundle();
Log.e("TEST", "Return " + np.getCurrent());
b.putInt("amount", np.getCurrent());
Intent i = new Intent();
i.putExtras(b);
setResult(1, i);
finish();
return true;
}
// TODO Auto-generated method stub
return super.onKeyUp(keyCode, event);
}
}
14 changes: 10 additions & 4 deletions src/org/androidaalto/soundfused/AndroidExplorer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/

package org.androidaalto.soundfused;

// taken from http://android-er.blogspot.com/2010/01/implement-simple-file-explorer-in.html
Expand All @@ -34,7 +35,6 @@
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;

import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
Expand All @@ -43,9 +43,13 @@
public class AndroidExplorer extends ListActivity {

private List<String> item = null;

private List<String> path = null;

private String root = "/sdcard"; // default was root

private TextView myPath;

private String regexp = "(?i:.*.(ogg|mp3))"; // available file extensions

/** Called when the activity is first created. */
Expand Down Expand Up @@ -90,7 +94,8 @@ private void getDir(String dirPath) {
}
}

ArrayAdapter<String> fileList = new ArrayAdapter<String>(this, R.layout.fileexplorer_row, item);
ArrayAdapter<String> fileList = new ArrayAdapter<String>(this, R.layout.fileexplorer_row,
item);
setListAdapter(fileList);
}

Expand All @@ -112,11 +117,12 @@ public void onClick(DialogInterface dialog, int which) {
}).show();
}
} else {
// Found a supported file type. Return the full path of the file to the caller activity (BoardActivity).
// Found a supported file type. Return the full path of the file to
// the caller activity (BoardActivity).
Intent resultIntent = new Intent(getApplicationContext(), BoardActivity.class);
resultIntent.putExtra("path", file.getPath());
setResult(Activity.RESULT_OK, resultIntent);
finish();
}
}
}
}
Loading

0 comments on commit d465cc4

Please sign in to comment.