|
|
|
@ -17,8 +17,6 @@ |
|
|
|
|
*/ |
|
|
|
|
package org.floens.chan.core.model; |
|
|
|
|
|
|
|
|
|
import android.content.Context; |
|
|
|
|
import android.os.Bundle; |
|
|
|
|
import android.os.Parcel; |
|
|
|
|
|
|
|
|
|
import com.j256.ormlite.field.DatabaseField; |
|
|
|
@ -114,26 +112,6 @@ public class Loadable { |
|
|
|
|
return mode == Mode.CATALOG; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void readFromBundle(Context context, String tag, Bundle bundle) { |
|
|
|
|
String p = context.getPackageName(); |
|
|
|
|
mode = bundle.getInt(p + "." + tag + ".mode", Mode.INVALID); |
|
|
|
|
board = bundle.getString(p + "." + tag + ".board", ""); |
|
|
|
|
no = bundle.getInt(p + "." + tag + ".no", -1); |
|
|
|
|
title = bundle.getString(p + "." + tag + ".subject", ""); |
|
|
|
|
listViewIndex = bundle.getInt(p + "." + tag + ".listViewIndex"); |
|
|
|
|
listViewTop = bundle.getInt(p + "." + tag + ".listViewTop"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void writeToBundle(Context context, String tag, Bundle bundle) { |
|
|
|
|
String p = context.getPackageName(); |
|
|
|
|
bundle.putInt(p + "." + tag + ".mode", mode); |
|
|
|
|
bundle.putString(p + "." + tag + ".board", board); |
|
|
|
|
bundle.putInt(p + "." + tag + ".no", no); |
|
|
|
|
bundle.putString(p + "." + tag + ".subject", title); |
|
|
|
|
bundle.putInt(p + "." + tag + ".listViewIndex", listViewIndex); |
|
|
|
|
bundle.putInt(p + "." + tag + ".listViewTop", listViewTop); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void writeToParcel(Parcel parcel) { |
|
|
|
|
parcel.writeInt(mode); |
|
|
|
|
parcel.writeString(board); |
|
|
|
@ -165,18 +143,6 @@ public class Loadable { |
|
|
|
|
return copy; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void generateTitle(Post post) { |
|
|
|
|
title = Post.generateTitle(post); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void generateTitle() { |
|
|
|
|
if (mode == Mode.CATALOG) { |
|
|
|
|
title = "/" + board + "/"; |
|
|
|
|
} else { |
|
|
|
|
title = "/" + board + "/" + no; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static class Mode { |
|
|
|
|
public static final int INVALID = -1; |
|
|
|
|
public static final int THREAD = 0; |
|
|
|
|