Skip to content

Commit

Permalink
-fixed possible crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ds10 committed Jun 14, 2016
1 parent e33b689 commit 166e8a2
Show file tree
Hide file tree
Showing 6 changed files with 21,417 additions and 58 deletions.
4 changes: 2 additions & 2 deletions TV-Browser/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.tvbrowser.tvbrowser"
android:installLocation="internalOnly"
android:versionCode="396"
android:versionName="0.6.2.3" >
android:versionCode="397"
android:versionName="0.6.2.4" >

<uses-sdk
android:minSdkVersion="11"
Expand Down
21,347 changes: 21,347 additions & 0 deletions TV-Browser/proguard/mapping_397.txt

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion TV-Browser/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="info_version_new"><![CDATA[
<h2>0.6.2.3</h2>
<h2>0.6.2.4</h2>
&bull; möglicher Absturz beseitigt<br>
<h3>0.6.2.3</h3>
&bull; langer Klick auf Jetzt zeigt Als Nächstes im Tab Laufende Sendungen<br>
&bull; langer Klick auf Zeitknöpfe öffnet Zeitauswahl zur Eingabe beliebiger Zeiten<br>
&bull; Zeitknopf zur Auswahl beliebiger Zeiten zu Laufende Sendungen hinzugefügt<br>
Expand Down
4 changes: 3 additions & 1 deletion TV-Browser/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="info_version_new"><![CDATA[
<h2>0.6.2.3</h2>
<h2>0.6.2.4</h2>
&bull; fixed possible crash<br>
<h3>0.6.2.3</h3>
&bull; long click on now shows next in running programs tab<br>
&bull; long click on time buttons opens selection for any time in running programs tab<br>
&bull; added button to select any time in running programs tab<br>
Expand Down
42 changes: 22 additions & 20 deletions TV-Browser/src/org/tvbrowser/tvbrowser/FragmentFavorites.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ public void onStart() {

mMarkingsList.performItemClick(null, selection, -1);
}
else if(mFavoriteSelection != null && selection < mFavoriteSelection.getCount()) {
else if(mFavoriteSelection != null && selection >= 0 && selection < mFavoriteSelection.getCount()) {
if(mContainsListViewFavoriteSelection) {
mFavoriteSelection.performItemClick(null, selection, -1);
}
else if(selection >= 0) {
else {
mFavoriteSelection.setSelection(selection);
}
}
Expand Down Expand Up @@ -511,26 +511,28 @@ private WhereClause getWhereClause() {
}

private void selectFavorite(final int position) {
mCurrentSelection = mCurrentFavoriteSelection = mFavoriteList.get(position);
mWhereClause = getWhereClause();

final Activity tvb = getActivity();

if(tvb != null) {
((TvBrowser)tvb).updateFavoritesMenu(mCurrentFavoriteSelection.containsFavorite());
if(position >= 0 && position < mFavoriteList.size()) {
mCurrentSelection = mCurrentFavoriteSelection = mFavoriteList.get(position);
mWhereClause = getWhereClause();

handler.post(new Runnable() {
@Override
public void run() {
if(!isDetached() && getActivity() != null) {
getLoaderManager().restartLoader(0, null, FragmentFavorites.this);
final Activity tvb = getActivity();

if(tvb != null) {
((TvBrowser)tvb).updateFavoritesMenu(mCurrentFavoriteSelection.containsFavorite());

handler.post(new Runnable() {
@Override
public void run() {
if(!isDetached() && getActivity() != null) {
getLoaderManager().restartLoader(0, null, FragmentFavorites.this);
}
}
}
});
}

if(mIsStarted) {
PrefUtils.getSharedPreferences(PrefUtils.TYPE_PREFERENCES_SHARED_GLOBAL, tvb).edit().putInt(tvb.getString(R.string.PREF_MISC_LAST_FAVORITE_SELECTION), position).commit();
});
}
if(mIsStarted) {
PrefUtils.getSharedPreferences(PrefUtils.TYPE_PREFERENCES_SHARED_GLOBAL, tvb).edit().putInt(tvb.getString(R.string.PREF_MISC_LAST_FAVORITE_SELECTION), position).commit();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,47 +143,53 @@ public View getView(int position, View convertView, ViewGroup parent) {

boolean scale = convertView == null;

View view = super.getView(position, convertView, parent);
View view = new View(mContext);

if(scale) {
UiUtils.scaleTextViews(view, textScale);
try {
view = super.getView(position, convertView, parent);

tag = new ProgTag();

tag.mOrientation = SettingConstants.ORIENTATION;
tag.mTextScale = textScale;
tag.mPadding = padding;
tag.mPaddingView = view.findViewById(R.id.programs_list_row);

view.setTag(tag);
}

tag.mPaddingView.setPadding(0, tag.mPadding, 0, tag.mPadding);

if(mOnClickListener != null) {
View listEntry = tag.mPaddingView;

if(listEntry.getTag() == null) {
listEntry.setOnClickListener(mOnClickListener);
listEntry.setOnCreateContextMenuListener(mContextMenuListener);
if(scale) {
UiUtils.scaleTextViews(view, textScale);

tag = new ProgTag();

tag.mOrientation = SettingConstants.ORIENTATION;
tag.mTextScale = textScale;
tag.mPadding = padding;
tag.mPaddingView = view.findViewById(R.id.programs_list_row);

view.setTag(tag);
}

listEntry.setTag(getItemId(position));
tag.mPaddingView.setPadding(0, tag.mPadding, 0, tag.mPadding);

View channelEntry = view.findViewById(R.id.program_list_channel_info);

ChannelProgInfo info = (ChannelProgInfo)channelEntry.getTag();

if(info == null) {
info = new ChannelProgInfo();
channelEntry.setOnClickListener(mChannelSwitchListener);
channelEntry.setTag(info);
if(mOnClickListener != null) {
View listEntry = tag.mPaddingView;

if(listEntry.getTag() == null) {
listEntry.setOnClickListener(mOnClickListener);
listEntry.setOnCreateContextMenuListener(mContextMenuListener);
}

listEntry.setTag(getItemId(position));

View channelEntry = view.findViewById(R.id.program_list_channel_info);

ChannelProgInfo info = (ChannelProgInfo)channelEntry.getTag();

if(info == null) {
info = new ChannelProgInfo();
channelEntry.setOnClickListener(mChannelSwitchListener);
channelEntry.setTag(info);
}

Cursor c = getCursor();

info.mID = c.getInt(c.getColumnIndex(TvBrowserContentProvider.CHANNEL_KEY_CHANNEL_ID));
info.mStartTime = c.getLong(c.getColumnIndex(TvBrowserContentProvider.DATA_KEY_STARTTIME));
}
}catch(IllegalStateException ise) {

Cursor c = getCursor();

info.mID = c.getInt(c.getColumnIndex(TvBrowserContentProvider.CHANNEL_KEY_CHANNEL_ID));
info.mStartTime = c.getLong(c.getColumnIndex(TvBrowserContentProvider.DATA_KEY_STARTTIME));
}

return view;
Expand Down

0 comments on commit 166e8a2

Please sign in to comment.