-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed image buttons to normal buttons with text.
- Loading branch information
Showing
9 changed files
with
112 additions
and
86 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package de.storch.fluchomat; | ||
|
||
import android.view.View; | ||
import android.view.View.OnClickListener; | ||
import android.view.ViewGroup; | ||
import android.widget.BaseAdapter; | ||
import android.widget.Button; | ||
|
||
public class ListAdapter extends BaseAdapter { | ||
|
||
private FluchomatActivity mContext; | ||
|
||
public ListAdapter(FluchomatActivity c) { | ||
mContext = c; | ||
} | ||
|
||
public int getCount() { | ||
return 16; | ||
} | ||
|
||
public Object getItem(int position) { | ||
return null; | ||
} | ||
|
||
public long getItemId(int position) { | ||
return 0; | ||
} | ||
|
||
// create a new ImageView for each item referenced by the Adapter | ||
public View getView(final int position, View convertView, ViewGroup parent) { | ||
Button listItem; | ||
if (convertView == null) { // if it's not recycled, initialize some attributes | ||
listItem = new Button(mContext); | ||
listItem.setText(mContext.getSoundText(position)); | ||
listItem.setOnClickListener(new OnClickListener() { | ||
|
||
@Override | ||
public void onClick(View v) { | ||
mContext.playSound(position); | ||
} | ||
}); | ||
} else { | ||
listItem = (Button) convertView; | ||
} | ||
|
||
return listItem; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package de.storch.fluchomat; | ||
|
||
/** | ||
* One Sound with id and text | ||
*/ | ||
public class Sound { | ||
|
||
private int id; | ||
private String text; | ||
|
||
public Sound(int id, String text) { | ||
this.id = id; | ||
this.text = text; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.