Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Apr 22, 2014
1 parent 0f0dd4e commit 7eb89aa
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/com/stefansundin/glass/movies/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,18 @@

public class MainActivity extends Activity
implements TextToSpeech.OnInitListener {
public MainActivity mActivity;

private String mMovieDirectory;
private ListView mListView;
private ArrayAdapter<String> mMovieList;
private GestureDetector mGestureDetector;
private TextToSpeech mSpeech;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout);
mActivity = this;

mListView = (ListView) findViewById(R.id.listView);

mMovieList = new ArrayAdapter<String>(this, android.R.layout.test_list_item);
mListView.setAdapter(mMovieList);
ArrayAdapter<String> movieList = new ArrayAdapter<String>(this, android.R.layout.test_list_item);
ListView listView = (ListView) findViewById(R.id.listView);
listView.setAdapter(movieList);

mMovieDirectory = Environment.getExternalStorageDirectory()+"/"+Environment.DIRECTORY_MOVIES;
Log.d("stefan", "Movie directory: "+mMovieDirectory);
Expand All @@ -46,12 +41,12 @@ protected void onCreate(Bundle savedInstanceState) {
}
java.util.Collections.sort(filenames);
for (String filename : filenames) {
mMovieList.add(filename);
movieList.add(filename);
}

mSpeech = new TextToSpeech(this, this);

Touchpad touchpad = new Touchpad(mListView, this);
Touchpad touchpad = new Touchpad(listView, this);
mGestureDetector = new GestureDetector(this);
mGestureDetector.setBaseListener(touchpad);
mGestureDetector.setFingerListener(touchpad);
Expand Down

0 comments on commit 7eb89aa

Please sign in to comment.