Skip to content

Commit

Permalink
Merge pull request #463 from Greznor/android-studio
Browse files Browse the repository at this point in the history
Bug fixes and New Boards
  • Loading branch information
johnarleyburns committed Nov 30, 2015
2 parents 036cb8f + a9f8fdc commit f9abd00
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 12 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/com/chanapps/four/ChanuApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
*
*/

public class ChanuApp extends Application
public class ChanuApp extends GalleryAppImpl
{

private static final boolean DEBUG = false;
private static final String TAG = ChanuApp.class.getSimpleName();
private static Locale locale = null;
/*

public synchronized DataManager getDataManager() {
if (mDataManager == null) {
mDataManager = new DataManager(this);
Expand All @@ -38,7 +38,7 @@ public synchronized DataManager getDataManager() {
}
return mDataManager;
}
*/

@Override
public void onCreate() {
super.onCreate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
public class PostReplyActivity extends FragmentActivity implements ChanIdentifiedActivity, ThemeSelector.ThemeActivity {

public static final String TAG = PostReplyActivity.class.getSimpleName();
private static final boolean DEBUG = false;
private static final boolean DEBUG = true;

public static final String BOARD_CODE = "postReplyBoardCode";
public static final String THREAD_NO = "postReplyThreadNo";
Expand Down Expand Up @@ -894,6 +894,7 @@ private void sage() {
private void startGallery() {
if (DEBUG) Log.i(TAG, "startGallery()");
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
//intent.setType("image/*|video/webm");
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, IMAGE_GALLERY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class URLFormatComponent {
public static final String CHAN_POST_URL_FORMAT = "//sys.4chan.org/%s/post";
public static final String CHAN_SPOILER_IMAGE_URL_FORMAT = "//s.4cdn.org/image/spoiler-%s.png";
public static final String CHAN_SPOILER_NUMBERED_IMAGE_URL_FORMAT = "//s.4cdn.org/image/spoiler-%s%d.png";
public static final String CHAN_THREAD_URL_FORMAT = "//a.4cdn.org/%s/res/%d.json";
public static final String CHAN_THREAD_URL_FORMAT = "//a.4cdn.org/%s/thread/%d.json";
public static final String CHAN_THUMBS_URL_FORMAT = "//t.4cdn.org/%s/thumb/%ds.jpg";
public static final String CHAN_WEB_BOARD_URL_FORMAT = "//boards.4chan.org/%s/";
public static final String CHAN_WEB_POST_URL_FORMAT = "//boards.4chan.org/%s/res/%d#p%d";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public static String[][] initBoardCodes(Context ctx) {
"adv", ctx.getString(R.string.board_adv),
"lgbt", ctx.getString(R.string.board_lgbt),
"mlp", ctx.getString(R.string.board_mlp),
"news", ctx.getString(R.string.board_news),
"qa", ctx.getString(R.string.board_qa),
},
{ BoardType.ADULT.toString(),
Expand All @@ -101,6 +102,7 @@ public static String[][] initBoardCodes(Context ctx) {
"d", ctx.getString(R.string.board_d),
"y", ctx.getString(R.string.board_y),
"t", ctx.getString(R.string.board_t),

"hr", ctx.getString(R.string.board_hr),
"gif", ctx.getString(R.string.board_gif),
"aco", ctx.getString(R.string.board_aco)
Expand All @@ -113,7 +115,7 @@ public static String[][] initBoardCodes(Context ctx) {
"pol", ctx.getString(R.string.board_pol),
"soc", ctx.getString(R.string.board_soc),
"s4s", ctx.getString(R.string.board_s4s),

"trash", ctx.getString(R.string.board_trash)
},
{
BoardType.ALL_BOARDS.toString(),
Expand Down Expand Up @@ -154,6 +156,7 @@ public static String[][] initBoardCodes(Context ctx) {
"mlp", ctx.getString(R.string.board_mlp),
"mu", ctx.getString(R.string.board_mu),
"n", ctx.getString(R.string.board_n),
"news", ctx.getString(R.string.board_news),
"o", ctx.getString(R.string.board_o),
"out", ctx.getString(R.string.board_out),
"p", ctx.getString(R.string.board_p),
Expand All @@ -170,6 +173,7 @@ public static String[][] initBoardCodes(Context ctx) {
"t", ctx.getString(R.string.board_t),
"tg", ctx.getString(R.string.board_tg),
"toy", ctx.getString(R.string.board_toy),
"trash", ctx.getString(R.string.board_trash),
"trv", ctx.getString(R.string.board_trv),
"tv", ctx.getString(R.string.board_tv),
"u", ctx.getString(R.string.board_u),
Expand All @@ -182,7 +186,6 @@ public static String[][] initBoardCodes(Context ctx) {
"wsg", ctx.getString(R.string.board_wsg),
"x", ctx.getString(R.string.board_x),
"y", ctx.getString(R.string.board_y),

"3", ctx.getString(R.string.board_3),
}
};
Expand Down Expand Up @@ -228,6 +231,7 @@ public static HashMap<String, int[]> initBoardDrawables() {
boardDrawables.put("mlp", new int[]{ R.drawable.mlp, R.drawable.mlp_2, R.drawable.mlp_3 } );
boardDrawables.put("mu", new int[]{ R.drawable.mu, R.drawable.mu_2, R.drawable.mu_3 } );
boardDrawables.put("n", new int[]{ R.drawable.n, R.drawable.n_2, R.drawable.n_3 } );
boardDrawables.put("news", new int[]{ R.drawable.news, R.drawable.news, R.drawable.news } );
boardDrawables.put("p", new int[]{ R.drawable.p, R.drawable.p_2, R.drawable.p_3 } );
boardDrawables.put("po", new int[]{ R.drawable.po, R.drawable.po_2, R.drawable.po_3 } );
boardDrawables.put("pol", new int[]{ R.drawable.pol, R.drawable.pol_2, R.drawable.pol_3 } );
Expand All @@ -246,6 +250,7 @@ public static HashMap<String, int[]> initBoardDrawables() {
boardDrawables.put("tg", new int[]{ R.drawable.tg, R.drawable.tg_2, R.drawable.tg_3 } );
boardDrawables.put("toy", new int[]{ R.drawable.toy, R.drawable.toy_2, R.drawable.toy_3 } );
boardDrawables.put("trv", new int[]{ R.drawable.trv, R.drawable.trv_2, R.drawable.trv_3 } );
boardDrawables.put("trash", new int[]{ R.drawable.trash, R.drawable.trash, R.drawable.trash } );
boardDrawables.put("tv", new int[]{ R.drawable.tv, R.drawable.tv_2, R.drawable.tv_3 } );
boardDrawables.put("u", new int[]{ R.drawable.u, R.drawable.u_2, R.drawable.u_3 } );
boardDrawables.put("v", new int[]{ R.drawable.v, R.drawable.v_2, R.drawable.v_3 } );
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/com/chanapps/four/data/BoardType.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ public enum BoardType {
false, false, true, "watchlist", R.string.board_empty_watchlist, R.string.board_watch),
FAVORITES (R.string.board_favorites,
R.drawable.star, R.drawable.star_light,
false, false, true, "favorites", R.string.board_empty_favorites, R.string.board_favorites);
false, false, true, "favorites", R.string.board_empty_favorites, R.string.board_favorites),
TRIAL (R.string.board_type_other,
R.drawable.speech_bubble_ellipsis, R.drawable.speech_bubble_ellipsis_light,
true, true, true, "trial", R.string.board_empty_all_boards, R.string.board_type_other),;


private final int displayStringId;
private final int drawableId;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/chanapps/four/data/ChanBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static public String spoilerThumbnailUrl(Context context, String boardCode) {
}

static public boolean isAsciiOnlyBoard(String boardCode) {
if (boardCode.equals("q") || boardCode.equals("r9k"))
if (boardCode.equals("q") || boardCode.equals("r9k") || boardCode.equals("news"))
return true;
else
return false;
Expand Down
Binary file modified app/src/main/res/drawable/aco.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/news.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/trash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 25 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
<string name="board_sci">Science &amp; Math</string>
<string name="board_int">International</string>
<string name="board_out">Outdoors</string>
<string name="board_type_creative">Creative</string>

<string name="board_i">Oekaki</string>
<string name="board_po">Papercraft &amp; Origami</string>
<string name="board_p">Photography</string>
Expand All @@ -414,7 +414,7 @@
<string name="board_gd">Graphic Design</string>
<string name="board_diy">Do-It-Yourself</string>
<string name="board_wsg">Worksafe GIF</string>
<string name="board_type_adult">Adult</string>

<string name="board_s">Sexy Beautiful Women</string>
<string name="board_hc">Hardcore</string>
<string name="board_hm">Handsome Men</string>
Expand All @@ -435,7 +435,7 @@
<string name="board_adv">Advice</string>
<string name="board_lgbt">LGBT</string>
<string name="board_mlp">Pony</string>
<string name="board_type_misc">Misc</string>

<string name="board_b">Random</string>
<string name="board_r">Request</string>
<string name="board_r9k">ROBOT9001</string>
Expand All @@ -445,6 +445,13 @@
<string name="board_aco">Adult Cartoons</string>
<string name="board_his">History &amp; Humanities</string>
<string name="board_qa">Questions &amp; Answers</string>
<string name="board_news">Current News</string>
<string name="board_trash">Off-Topic</string>


<string name="board_type_adult">Adult</string>
<string name="board_type_creative">Creative</string>
<string name="board_type_misc">Misc</string>

<string name="board_watch">Thread Watchlist</string>
<string name="board_favorites">Favorite Boards</string>
Expand Down Expand Up @@ -491,6 +498,7 @@
<string name="board_desc_mlp">Pony heaven</string>
<string name="board_desc_mu">Fans, haters, and audio</string>
<string name="board_desc_n">Trains and bikes</string>
<string name="board_desc_news">Breaking headlines</string>
<string name="board_desc_o">Rides and car talk</string>
<string name="board_desc_out">Hiking and camping</string>
<string name="board_desc_p">Content and criticism</string>
Expand All @@ -509,6 +517,7 @@
<string name="board_desc_t">Share links</string>
<string name="board_desc_tg">Boards and roleplay</string>
<string name="board_desc_toy">Figures and collectibles</string>
<string name="board_desc_trash">Garbage and unwanted posts</string>
<string name="board_desc_trv">Journeys, adventures</string>
<string name="board_desc_tv">Series and sets</string>
<string name="board_desc_u">Lesbian anime</string>
Expand Down Expand Up @@ -987,6 +996,13 @@ We will remove anything that remotely breaks this rule.</p>
]]>
</string>

<string name="board_news_rules">
<![CDATA[
<h3>/news/ - News</h3>
]]>
</string>


<string name="board_o_rules">
<![CDATA[
Expand Down Expand Up @@ -1200,6 +1216,12 @@ We will remove anything that remotely breaks this rule.</p>
]]>
</string>

<string name="board_trash_rules">
<![CDATA[
<h3>/trasb/ - Trash</h3>
]]>
</string>

<string name="board_trv_rules">
<![CDATA[
Expand Down

0 comments on commit f9abd00

Please sign in to comment.