From 034e14235e987b30d0ebc181b2d24c632035c453 Mon Sep 17 00:00:00 2001 From: Renard Date: Mon, 25 Apr 2016 20:48:52 -0300 Subject: v1.7 --- app/build.gradle | 1 + .../main/java/layout/FragmentBoardItemList.java | 38 ++- .../baiparser/MainActivity.java | 84 +++++- .../baiparser/ResponseActivity.java | 298 +++++++++++++++------ .../baiparser/ThreadListAdapter.java | 35 ++- .../baiparser/structure/Board.java | 15 +- .../baiparser/structure/BoardItem.java | 43 ++- .../baiparser/structure/ReplyID.java | 10 +- app/src/main/res/drawable-hdpi/ic_action_add.png | Bin 0 -> 134 bytes .../res/drawable-hdpi/ic_action_font_underline.png | Bin 0 -> 325 bytes .../main/res/drawable-hdpi/ic_action_list_2.png | Bin 0 -> 186 bytes app/src/main/res/drawable-hdpi/ic_code.png | Bin 0 -> 190 bytes .../res/drawable-hdpi/ic_format_list_bulleted.png | Bin 0 -> 193 bytes .../res/drawable-hdpi/ic_format_strikethrough.png | Bin 0 -> 157 bytes .../res/drawable-hdpi/ic_format_underlined.png | Bin 0 -> 234 bytes app/src/main/res/drawable-mdpi/ic_action_add.png | Bin 0 -> 116 bytes .../res/drawable-mdpi/ic_action_font_underline.png | Bin 0 -> 237 bytes .../main/res/drawable-mdpi/ic_action_list_2.png | Bin 0 -> 136 bytes app/src/main/res/drawable-mdpi/ic_code.png | Bin 0 -> 144 bytes .../res/drawable-mdpi/ic_format_list_bulleted.png | Bin 0 -> 82 bytes .../res/drawable-mdpi/ic_format_strikethrough.png | Bin 0 -> 96 bytes .../res/drawable-mdpi/ic_format_underlined.png | Bin 0 -> 150 bytes app/src/main/res/drawable-xhdpi/ic_action_add.png | Bin 0 -> 168 bytes .../drawable-xhdpi/ic_action_font_underline.png | Bin 0 -> 422 bytes .../main/res/drawable-xhdpi/ic_action_list_2.png | Bin 0 -> 219 bytes app/src/main/res/drawable-xhdpi/ic_code.png | Bin 0 -> 202 bytes .../res/drawable-xhdpi/ic_format_list_bulleted.png | Bin 0 -> 97 bytes .../res/drawable-xhdpi/ic_format_strikethrough.png | Bin 0 -> 106 bytes .../res/drawable-xhdpi/ic_format_underlined.png | Bin 0 -> 223 bytes app/src/main/res/drawable-xxhdpi/ic_action_add.png | Bin 0 -> 242 bytes .../drawable-xxhdpi/ic_action_font_underline.png | Bin 0 -> 612 bytes .../main/res/drawable-xxhdpi/ic_action_list_2.png | Bin 0 -> 331 bytes app/src/main/res/drawable-xxhdpi/ic_code.png | Bin 0 -> 299 bytes .../drawable-xxhdpi/ic_format_list_bulleted.png | Bin 0 -> 113 bytes .../drawable-xxhdpi/ic_format_strikethrough.png | Bin 0 -> 119 bytes .../res/drawable-xxhdpi/ic_format_underlined.png | Bin 0 -> 338 bytes .../main/res/drawable-xxxhdpi/ic_action_add.png | Bin 0 -> 500 bytes .../drawable-xxxhdpi/ic_action_font_underline.png | Bin 0 -> 1477 bytes .../main/res/drawable-xxxhdpi/ic_action_list_2.png | Bin 0 -> 794 bytes app/src/main/res/drawable-xxxhdpi/ic_code.png | Bin 0 -> 306 bytes .../drawable-xxxhdpi/ic_format_list_bulleted.png | Bin 0 -> 227 bytes .../drawable-xxxhdpi/ic_format_strikethrough.png | Bin 0 -> 131 bytes .../res/drawable-xxxhdpi/ic_format_underlined.png | Bin 0 -> 416 bytes app/src/main/res/drawable/Thumbs.db | Bin 26624 -> 26624 bytes app/src/main/res/layout/activity_response.xml | 139 +++++++--- app/src/main/res/layout/thread_item.xml | 1 - app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/preferences.xml | 4 + 48 files changed, 505 insertions(+), 164 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_action_add.png create mode 100644 app/src/main/res/drawable-hdpi/ic_action_font_underline.png create mode 100644 app/src/main/res/drawable-hdpi/ic_action_list_2.png create mode 100644 app/src/main/res/drawable-hdpi/ic_code.png create mode 100644 app/src/main/res/drawable-hdpi/ic_format_list_bulleted.png create mode 100644 app/src/main/res/drawable-hdpi/ic_format_strikethrough.png create mode 100644 app/src/main/res/drawable-hdpi/ic_format_underlined.png create mode 100644 app/src/main/res/drawable-mdpi/ic_action_add.png create mode 100644 app/src/main/res/drawable-mdpi/ic_action_font_underline.png create mode 100644 app/src/main/res/drawable-mdpi/ic_action_list_2.png create mode 100644 app/src/main/res/drawable-mdpi/ic_code.png create mode 100644 app/src/main/res/drawable-mdpi/ic_format_list_bulleted.png create mode 100644 app/src/main/res/drawable-mdpi/ic_format_strikethrough.png create mode 100644 app/src/main/res/drawable-mdpi/ic_format_underlined.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_action_add.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_action_font_underline.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_action_list_2.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_code.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_format_list_bulleted.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_format_strikethrough.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_format_underlined.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_add.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_font_underline.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_list_2.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_code.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_format_list_bulleted.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_format_strikethrough.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_format_underlined.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_action_add.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_action_font_underline.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_action_list_2.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_code.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_format_strikethrough.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_format_underlined.png (limited to 'app') diff --git a/app/build.gradle b/app/build.gradle index a41bd51..db7e212 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -28,6 +28,7 @@ dependencies { compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.4.1' compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.14' compile 'com.koushikdutta.ion:ion:2.+' + compile 'org.jsoup:jsoup:1.9.1' } diff --git a/app/src/main/java/layout/FragmentBoardItemList.java b/app/src/main/java/layout/FragmentBoardItemList.java index ba80ae5..feaf7a0 100644 --- a/app/src/main/java/layout/FragmentBoardItemList.java +++ b/app/src/main/java/layout/FragmentBoardItemList.java @@ -410,6 +410,11 @@ public class FragmentBoardItemList extends Fragment { void updateToolbar(String s); void hideActionButton(); void showActionButton(); + void onThreadList(); + + void onThread(); + + void onRecentPosts(); } public void scrollToBotton(){ @@ -459,7 +464,6 @@ public class FragmentBoardItemList extends Fragment { item.setFile(thread.getString("file")); item.setFilesize(thread.getInt("file_size")); item.setId(thread.getInt("id")); - item.setMessage(thread.getString("message")); item.setName(thread.getString("name")); item.setSubject(thread.getString("subject")); item.setThumb(thread.getString("thumb")); @@ -470,6 +474,7 @@ public class FragmentBoardItemList extends Fragment { item.setTotalReplies(thread.getInt("total_replies")); item.setTripcode(thread.getString("tripcode")); item.setTimeStampFormatted(thread.getString("timestamp_formatted")); + item.setLockStatus(thread.getInt("locked")); if (item.getTimeStampFormatted().contains("ID")){ item.setPosterId(item.getTimeStampFormatted().split(" ")[1].replace("ID :", "")); } @@ -479,6 +484,7 @@ public class FragmentBoardItemList extends Fragment { if (currentBoard.getBoardType() == 1){ item.setBbsId(1); } + item.setMessage(thread.getString("message")); boardItems.add(item); if (!repliesForCatalog.equals("0")){ JSONArray replies = thread.getJSONArray("replies"); @@ -495,7 +501,7 @@ public class FragmentBoardItemList extends Fragment { reply.setFilesize(jReply.getInt("file_size")); reply.setId(jReply.getInt("id")); reply.setParentId(item.getId()); - reply.setMessage(jReply.getString("message")); + reply.setLockStatus(item.isLocked ? 1 : 0); reply.setName(jReply.getString("name")); reply.setSubject(jReply.getString("subject")); reply.setThumb(jReply.getString("thumb")); @@ -512,10 +518,12 @@ public class FragmentBoardItemList extends Fragment { reply.setIdColor(addReplyID(reply.getPosterId())); // reply.setTotalReplies(item.getTotalReplies()); + reply.setMessage(jReply.getString("message")); }else{ reply.setTimeStamp(jReply.getLong("timestamp")); reply.setId(jReply.getInt("id")); reply.isReply = true; + reply.setLockStatus(item.isLocked ? 1 : 0); } boardItems.add(reply); } @@ -528,6 +536,7 @@ public class FragmentBoardItemList extends Fragment { } listViewAdapter.notifyDataSetChanged(); listViewAdapter.updateBoardItems(boardItems); + mListener.onThreadList(); loadingMoreThreads = false; if (boardItems.isEmpty()){ mListener.updateToolbar(currentBoard, currentThread); @@ -575,7 +584,6 @@ public class FragmentBoardItemList extends Fragment { item.setFile(reply.getString("file")); item.setFilesize(reply.getInt("file_size")); item.setId(reply.getInt("id")); - item.setMessage(reply.getString("message")); item.setName(reply.getString("name")); item.setSubject(reply.getString("subject")); item.setThumb(reply.getString("thumb")); @@ -583,6 +591,7 @@ public class FragmentBoardItemList extends Fragment { item.setThumbWidth(reply.getInt("thumb_width")); item.setTimeStamp(reply.getLong("timestamp")); item.setParentId(json.getInt("id")); + item.setLockStatus(json.getInt("locked")); item.setTripcode(reply.getString("tripcode")); item.setTimeStampFormatted(reply.getString("timestamp_formatted")); if (item.getTimeStampFormatted().contains("ID")){ @@ -599,6 +608,7 @@ public class FragmentBoardItemList extends Fragment { item.setBbsId((item.getTotalReplies() - finalLimit + i) + 2); } } + item.setMessage(reply.getString("message")); } else { item.setId(reply.getInt("id")); @@ -626,6 +636,7 @@ public class FragmentBoardItemList extends Fragment { listViewBoardItems.setSelection(boardItems.size()); mListener.showActionButton(); } + mListener.onThread(); hideProgressBar(); } }); @@ -658,7 +669,6 @@ public class FragmentBoardItemList extends Fragment { recentPost.setFile(jPost.getString("file")); recentPost.setFilesize(jPost.getInt("file_size")); recentPost.setId(jPost.getInt("id")); - recentPost.setMessage(jPost.getString("message")); recentPost.setName(jPost.getString("name")); recentPost.setSubject(jPost.getString("subject")); recentPost.setThumb(jPost.getString("thumb")); @@ -672,6 +682,7 @@ public class FragmentBoardItemList extends Fragment { } recentPost.setParentBoard(((MainActivity) getActivity()).getBoardFromDir(jPost.getString("dir"))); recentPost.setParentId(jPost.getInt("parentid")); + recentPost.setMessage(jPost.getString("message")); boardItems.add(recentPost); } } catch (JSONException e1) { @@ -680,6 +691,7 @@ public class FragmentBoardItemList extends Fragment { } } recentPostAdapter.notifyDataSetChanged(); + mListener.onRecentPosts(); } }); @@ -696,7 +708,13 @@ public class FragmentBoardItemList extends Fragment { if (!directory.exists()){ directory.mkdir(); } - final File mypath = new File(directory, currentBoard.getBoardDir() + "_" + bi.getThumb()); + final File mypath; + if (bi.youtubeLink){ + mypath = new File(directory, currentBoard.getBoardDir() + "_" + bi.youtubeID); + }else{ + mypath = new File(directory, currentBoard.getBoardDir() + "_" + bi.getThumb()); + } + if (mypath.exists()){ try { Bitmap b = BitmapFactory.decodeStream(new FileInputStream(mypath)); @@ -713,8 +731,12 @@ public class FragmentBoardItemList extends Fragment { Log.i("getThumb", "Not using wifi"); return; } + String imgURL = "http://bienvenidoainternet.org/" + bi.getParentBoard().getBoardDir() + "/thumb/" + bi.getThumb(); + if (bi.getThumb().startsWith("http")){ + imgURL = bi.getThumb(); + } Ion.with(getContext()) - .load("http://bienvenidoainternet.org/" + bi.getParentBoard().getBoardDir() + "/thumb/" + bi.getThumb()) + .load(imgURL) .setLogging("getThumbnail", Log.INFO) .asBitmap() .setCallback(new FutureCallback() { @@ -778,8 +800,8 @@ public class FragmentBoardItemList extends Fragment { public int addReplyID(String s){ - if (!idList.contains(new ReplyID(s))){ - idList.add(new ReplyID(s)); + if (!idList.contains(new ReplyID(s, tm))){ + idList.add(new ReplyID(s, tm)); } for (ReplyID r : idList){ if (r.id.equals(s)){return r.color;} diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java b/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java index 87ac15a..9a6a344 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java @@ -120,17 +120,37 @@ public class MainActivity extends AppCompatActivity fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - if (childFragment.currentBoard != null) { - if (!childFragment.boardItems.isEmpty()) { - try { - Intent in = new Intent(getApplicationContext(), ResponseActivity.class); - Bundle b = new Bundle(); - b.putParcelable("theReply", childFragment.boardItems.get(0)); - b.putBoolean("quoting", false); - in.putExtras(b); - startActivity(in); - } catch (Exception e) { - e.printStackTrace(); + if (pager.getCurrentItem() == 0){ + if (!mainFragment.getMode() && mainFragment.currentBoard != null){ + Intent in = new Intent(getApplicationContext(), ResponseActivity.class); + Bundle b = new Bundle(); + BoardItem temp = new BoardItem(); + temp.setParentBoard(mainFragment.currentBoard); + b.putParcelable("theReply", temp); + b.putBoolean("quoting", false); + b.putBoolean("newthread", true); + in.putExtras(b); + startActivity(in); + } + }else{ + if (childFragment.currentBoard != null) { + if (!childFragment.boardItems.isEmpty()) { + try { + Intent in = new Intent(getApplicationContext(), ResponseActivity.class); + Bundle b = new Bundle(); + BoardItem reply = childFragment.boardItems.get(0); + if (!reply.isLocked) { + b.putParcelable("theReply", reply); + b.putBoolean("quoting", false); + b.putBoolean("newthread", false); + in.putExtras(b); + startActivity(in); + }else{ + Toast.makeText(getApplicationContext(), "Error: Este hilo está cerrado", Toast.LENGTH_LONG).show(); + } + } catch (Exception e) { + e.printStackTrace(); + } } } } @@ -170,6 +190,7 @@ public class MainActivity extends AppCompatActivity @Override public void onPageSelected(int position) { if (position == 0){ + fab.setImageResource(R.drawable.ic_action_add); if (mainFragment.currentBoard != null) { toolbar.setTitle("Catálogo"); toolbar.setSubtitle(mainFragment.currentBoard.getBoardName()); @@ -178,14 +199,19 @@ public class MainActivity extends AppCompatActivity toolbar.setTitle("Post recientes"); toolbar.setSubtitle(""); } - fab.setVisibility(View.INVISIBLE); + if (mainFragment.getMode()){ + fab.hide(); + }else{ + fab.show(); + } }else if (position == 1){ + fab.setImageResource(R.drawable.ic_edit); if (childFragment.currentBoard != null) { toolbar.setTitle(childFragment.currentBoard.getBoardName()); if (!childFragment.boardItems.isEmpty()){ toolbar.setSubtitle(childFragment.boardItems.get(0).getSubject()); } - fab.setVisibility(View.VISIBLE); + fab.show(); } } } @@ -367,6 +393,32 @@ public class MainActivity extends AppCompatActivity } } + @Override + public void onThreadList() { + if (pager.getCurrentItem() == 0){ + getSupportActionBar().setTitle("Catálogo"); + getSupportActionBar().setSubtitle(mainFragment.currentBoard.getBoardName()); + fab.show(); + } + } + + @Override + public void onThread() { + if (pager.getCurrentItem() == 1){ + getSupportActionBar().setTitle(childFragment.currentBoard.getBoardName()); + getSupportActionBar().setSubtitle(childFragment.boardItems.get(0).getSubject()); + } + } + + @Override + public void onRecentPosts() { + if (pager.getCurrentItem() == 0){ + getSupportActionBar().setTitle("Post recientes"); + getSupportActionBar().setSubtitle(""); + fab.hide(); + } + } + private void getBoardList(){ Menu menu = navigationView.getMenu(); final SubMenu sub = menu.addSubMenu("Lista de Boards"); @@ -384,7 +436,7 @@ public class MainActivity extends AppCompatActivity JSONArray boards = new JSONObject(result).getJSONArray("boards"); for (int i = 0; i < boards.length(); i++) { JSONObject board = boards.getJSONObject(i); - Board parsedBoard = new Board(board.getString("name"), board.getString("dir"), board.getInt("board_type")); + Board parsedBoard = new Board(board.getString("name"), board.getString("dir"), board.getInt("board_type"), board.getInt("allow_image_replies") == 1 ? true : false); sub.add(parsedBoard.getBoardName()); boardList.add(parsedBoard); } @@ -395,6 +447,10 @@ public class MainActivity extends AppCompatActivity } } }); + + Board parsedBoard = new Board("Testing Field", "polka", 1, true); + sub.add(parsedBoard.getBoardName()); + boardList.add(parsedBoard); refreshNavigator(); } diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/ResponseActivity.java b/app/src/main/java/org/bienvenidoainternet/baiparser/ResponseActivity.java index 871aaf5..2a3ca24 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/ResponseActivity.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/ResponseActivity.java @@ -54,7 +54,7 @@ public class ResponseActivity extends AppCompatActivity { private String password; private String selectedFile = ""; private final int PICK_IMAGE = 1; - private boolean quoting = false; + private boolean quoting = false, newthread = false; EditText filePath; @Override @@ -63,18 +63,34 @@ public class ResponseActivity extends AppCompatActivity { ThemeManager tm = new ThemeManager(this); this.setTheme(tm.getThemeForActivity()); setContentView(R.layout.activity_response); - getSupportActionBar().setTitle("Respondiendo"); + settings = PreferenceManager.getDefaultSharedPreferences(this); password = settings.getString("pref_password", "12345678"); if (savedInstanceState != null){ this.theReply = savedInstanceState.getParcelable("theReply"); this.quoting = savedInstanceState.getBoolean("quoting"); + this.newthread = savedInstanceState.getBoolean("newthread"); } if (getIntent().getExtras() != null){ this.theReply = getIntent().getParcelableExtra("theReply"); this.quoting = getIntent().getBooleanExtra("quoting", false); + this.newthread = getIntent().getBooleanExtra("newthread", false); + } + + if (newthread){ + getSupportActionBar().setTitle("Nuevo hilo"); + getSupportActionBar().setSubtitle(theReply.getParentBoard().getBoardName()); + }else{ + getSupportActionBar().setTitle("Respondiendo"); } + + TextView txtFilePath = (TextView) findViewById(R.id.txtFilePath); + Button btnSelectFile = (Button) findViewById(R.id.btnSelectFiles); + TextView txtThreadSubject = (TextView) findViewById(R.id.txtThreadSubject); + + txtThreadSubject.setVisibility(newthread ? View.VISIBLE : View.GONE); + if (theReply != null && quoting){ TextView txtMessage = (TextView) findViewById(R.id.txtResponse); if (theReply.getParentBoard().getBoardType() == 1){ // BBS @@ -82,6 +98,9 @@ public class ResponseActivity extends AppCompatActivity { }else{ txtMessage.setText(">>" + theReply.getId()); } + }else if (theReply != null){ + txtFilePath.setVisibility(theReply.getParentBoard().isCanAttachFiles() ? View.VISIBLE : View.GONE); + btnSelectFile.setVisibility(theReply.getParentBoard().isCanAttachFiles() ? View.VISIBLE : View.GONE); } LinearLayout layoutProcess = (LinearLayout)findViewById(R.id.layoutPostProcess); @@ -89,39 +108,49 @@ public class ResponseActivity extends AppCompatActivity { filePath = (EditText) findViewById(R.id.txtFilePath); Button bBold = (Button) findViewById(R.id.buttonBold); + Button bStrike = (Button) findViewById(R.id.buttonStrike); + Button bList = (Button) findViewById(R.id.buttonList); + Button bCode = (Button) findViewById(R.id.buttonCode); + Button bUnder = (Button) findViewById(R.id.buttonUnderline); + Button bItalic = (Button) findViewById(R.id.buttonItalic); + Button select = (Button) findViewById(R.id.btnSelectFiles); + bBold.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - TextView txtMessage = (TextView) findViewById(R.id.txtResponse); - if (txtMessage.getSelectionStart() == -1){ - txtMessage.setText(txtMessage.getText() + ""); - }else{ - String s = txtMessage.getText().toString(); - String a = s.substring(0, txtMessage.getSelectionStart()); - String b = s.substring(txtMessage.getSelectionStart(), txtMessage.getSelectionEnd()); - String c = s.substring(txtMessage.getSelectionEnd(), txtMessage.getText().length()); - txtMessage.setText(a + "" + b + "" + c); - } + applyTag("b"); } }); - Button bItalic = (Button) findViewById(R.id.buttonItalic); bItalic.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - TextView txtMessage = (TextView) findViewById(R.id.txtResponse); - if (txtMessage.getSelectionStart() == -1){ - txtMessage.setText(txtMessage.getText() + ""); - }else{ - String s = txtMessage.getText().toString(); - String a = s.substring(0, txtMessage.getSelectionStart()); - String b = s.substring(txtMessage.getSelectionStart(), txtMessage.getSelectionEnd()); - String c = s.substring(txtMessage.getSelectionEnd(), txtMessage.getText().length()); - txtMessage.setText(a + "" + b + "" + c); - } + applyTag("i"); + } + }); + bStrike.setOnClickListener(new View.OnClickListener(){ + @Override + public void onClick(View v) { + applyTag("strike"); + } + }); + bList.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + applyTag("ul"); + } + }); + bCode.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + applyTag("code"); + } + }); + bUnder.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + applyTag("u"); } }); - - Button select = (Button) findViewById(R.id.btnSelectFiles); select.setOnClickListener(new View.OnClickListener() { @Override @@ -135,6 +164,19 @@ public class ResponseActivity extends AppCompatActivity { } + private void applyTag(String tag){ + TextView txtMessage = (TextView) findViewById(R.id.txtResponse); + if (txtMessage.getSelectionStart() == -1){ + txtMessage.setText(txtMessage.getText() + "<" + tag + ">"); + }else{ + String s = txtMessage.getText().toString(); + String a = s.substring(0, txtMessage.getSelectionStart()); + String b = s.substring(txtMessage.getSelectionStart(), txtMessage.getSelectionEnd()); + String c = s.substring(txtMessage.getSelectionEnd(), txtMessage.getText().length()); + txtMessage.setText(a + "<" + tag + ">" + b + "" + c); + } + } + @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_replyform, menu); @@ -147,7 +189,8 @@ public class ResponseActivity extends AppCompatActivity { TextView txtName = (TextView) findViewById(R.id.txtPosterName); TextView txtEmail = (TextView) findViewById(R.id.txtEmail); TextView txtMessage = (TextView) findViewById(R.id.txtResponse); - makePost(txtName.getText().toString(), txtEmail.getText().toString(), txtMessage.getText().toString()); + TextView txtThreadSubject = (TextView) findViewById(R.id.txtThreadSubject); + makePost(txtName.getText().toString(), txtEmail.getText().toString(), txtMessage.getText().toString(), txtThreadSubject.getText().toString()); } return super.onOptionsItemSelected(item); } @@ -168,10 +211,11 @@ public class ResponseActivity extends AppCompatActivity { super.onSaveInstanceState(outState); } - private void makePost(String name, String email, String message){ - int parentId = theReply.getParentId(); - if (theReply.getParentId() == 0 || theReply.getParentId() == -1){ - parentId = theReply.getId(); + private void makePost(String name, String email, String message, String subject){ + int parentId = theReply.realParentId(); + // Si el parentId = 0 && subject != "" ==> Nuevo hilo + if (newthread){ + parentId = 0; } LinearLayout layoutProcess = (LinearLayout)findViewById(R.id.layoutPostProcess); layoutProcess.setVisibility(View.VISIBLE); @@ -181,62 +225,146 @@ public class ResponseActivity extends AppCompatActivity { final TextView err = (TextView)findViewById(R.id.txtPostingState); err.setText(""); File up = new File(selectedFile); - if (selectedFile.isEmpty()) Ion.with(getApplicationContext()) - .load("http://bienvenidoainternet.org/cgi/post") - .setLogging("posting", Log.VERBOSE) - .uploadProgressBar(progess) - .setMultipartParameter("board", theReply.getParentBoard().getBoardDir()) - .setMultipartParameter("parent", String.valueOf(theReply.realParentId())) - .setMultipartParameter("password", password) - .setMultipartParameter("fielda", name) - .setMultipartParameter("fieldb", email) - .setMultipartParameter("name", "") - .setMultipartParameter("email", "") - .setMultipartParameter("message", message) - .asString() - .setCallback(new FutureCallback() { - @Override - public void onCompleted(Exception e, String result) { - Log.v("sendPost", result); - if (e != null) { - Toast.makeText(getApplicationContext(), "Ha ocurrido un error! ;_;", Toast.LENGTH_LONG).show(); - formSendPost.setVisibility(View.VISIBLE); - err.setText("Error: " + e.getMessage()); - e.printStackTrace(); - } else { - Toast.makeText(getApplicationContext(), "Post enviado", Toast.LENGTH_LONG).show(); - finish(); - } - } - }); - else{ - Ion.with(getApplicationContext()) - .load("http://bienvenidoainternet.org/cgi/post") - .uploadProgressBar(progess) - .setMultipartParameter("board", theReply.getParentBoard().getBoardDir()) - .setMultipartParameter("parent", String.valueOf(parentId)) - .setMultipartParameter("password", password) - .setMultipartParameter("fielda", name) - .setMultipartParameter("fieldb", email) - .setMultipartParameter("name", "") - .setMultipartParameter("email", "") - .setMultipartParameter("message", message) - .setMultipartFile("file", up) - .asDocument() - .setCallback(new FutureCallback() { - @Override - public void onCompleted(Exception e, Document result) { - if (e != null){ - Toast.makeText(getApplicationContext(), "Ha ocurrido un error! ;_;", Toast.LENGTH_LONG).show(); - formSendPost.setVisibility(View.VISIBLE); - err.setText("Error: " + e.getMessage()); - e.printStackTrace(); - }else{ - Toast.makeText(getApplicationContext(), "Post enviado", Toast.LENGTH_LONG).show(); - finish(); + + if (newthread){ + if (selectedFile.isEmpty()){ + Ion.with(getApplicationContext()) + .load("http://bienvenidoainternet.org/cgi/post") + .setLogging("posting", Log.VERBOSE) + .uploadProgressBar(progess) + .setMultipartParameter("board", theReply.getParentBoard().getBoardDir()) + .setMultipartParameter("password", password) + .setMultipartParameter("fielda", name) + .setMultipartParameter("fieldb", email) + .setMultipartParameter("name", "") + .setMultipartParameter("email", "") + .setMultipartParameter("message", message) + .setMultipartParameter("subject", subject) + .setMultipartParameter("noimage", "on") + .asString() + .setCallback(new FutureCallback() { + @Override + public void onCompleted(Exception e, String result) { + Log.v("sendPost", result); + if (e != null) { + Toast.makeText(getApplicationContext(), "Ha ocurrido un error! ;_;", Toast.LENGTH_LONG).show(); + formSendPost.setVisibility(View.VISIBLE); + err.setText("Error: " + e.getMessage()); + e.printStackTrace(); + } else { + if (result.contains("ERROR : Flood detectado.")){ + Toast.makeText(getApplicationContext(), "Error: Flood detectado.", Toast.LENGTH_LONG).show(); + }else{ + Toast.makeText(getApplicationContext(), "Post enviado", Toast.LENGTH_LONG).show(); + } + finish(); + } } - } - }); + }); + }else{ + Ion.with(getApplicationContext()) + .load("http://bienvenidoainternet.org/cgi/post") + .uploadProgressBar(progess) + .setMultipartParameter("board", theReply.getParentBoard().getBoardDir()) + .setMultipartParameter("password", password) + .setMultipartParameter("fielda", name) + .setMultipartParameter("fieldb", email) + .setMultipartParameter("name", "") + .setMultipartParameter("email", "") + .setMultipartParameter("message", message) + .setMultipartParameter("subject", subject) + .setMultipartFile("file", up) + .asString() + .setCallback(new FutureCallback() { + @Override + public void onCompleted(Exception e, String result) { + Log.v("sendPost", result); + if (e != null){ + Toast.makeText(getApplicationContext(), "Ha ocurrido un error! ;_;", Toast.LENGTH_LONG).show(); + formSendPost.setVisibility(View.VISIBLE); + err.setText("Error: " + e.getMessage()); + e.printStackTrace(); + }else{ + if (result.contains("ERROR : Flood detectado.")){ + Toast.makeText(getApplicationContext(), "Error: Flood detectado.", Toast.LENGTH_LONG).show(); + }else{ + Toast.makeText(getApplicationContext(), "Post enviado", Toast.LENGTH_LONG).show(); + } + finish(); + } + } + }); + } + }else{ + if (selectedFile.isEmpty()){ + Ion.with(getApplicationContext()) + .load("http://bienvenidoainternet.org/cgi/post") + .setLogging("posting", Log.VERBOSE) + .uploadProgressBar(progess) + .setMultipartParameter("board", theReply.getParentBoard().getBoardDir()) + .setMultipartParameter("parent", String.valueOf(parentId)) + .setMultipartParameter("password", password) + .setMultipartParameter("fielda", name) + .setMultipartParameter("fieldb", email) + .setMultipartParameter("name", "") + .setMultipartParameter("email", "") + .setMultipartParameter("message", message) + .setMultipartParameter("subject", subject) + .asString() + .setCallback(new FutureCallback() { + @Override + public void onCompleted(Exception e, String result) { + Log.v("sendPost", result); + if (e != null) { + Toast.makeText(getApplicationContext(), "Ha ocurrido un error! ;_;", Toast.LENGTH_LONG).show(); + formSendPost.setVisibility(View.VISIBLE); + err.setText("Error: " + e.getMessage()); + e.printStackTrace(); + } else { + if (result.contains("ERROR : Flood detectado.")){ + Toast.makeText(getApplicationContext(), "Error: Flood detectado.", Toast.LENGTH_LONG).show(); + }else{ + Toast.makeText(getApplicationContext(), "Post enviado", Toast.LENGTH_LONG).show(); + } + finish(); + } + } + }); + }else{ + Ion.with(getApplicationContext()) + .load("http://bienvenidoainternet.org/cgi/post") + .uploadProgressBar(progess) + .setMultipartParameter("board", theReply.getParentBoard().getBoardDir()) + .setMultipartParameter("parent", String.valueOf(parentId)) + .setMultipartParameter("password", password) + .setMultipartParameter("fielda", name) + .setMultipartParameter("fieldb", email) + .setMultipartParameter("name", "") + .setMultipartParameter("email", "") + .setMultipartParameter("message", message) + .setMultipartParameter("subject", subject) + .setMultipartFile("file", up) + .asString() + .setCallback(new FutureCallback() { + @Override + public void onCompleted(Exception e, String result) { + Log.v("sendPost", result); + if (e != null){ + Toast.makeText(getApplicationContext(), "Ha ocurrido un error! ;_;", Toast.LENGTH_LONG).show(); + formSendPost.setVisibility(View.VISIBLE); + err.setText("Error: " + e.getMessage()); + e.printStackTrace(); + }else{ + if (result.contains("ERROR : Flood detectado.")){ + Toast.makeText(getApplicationContext(), "Error: Flood detectado.", Toast.LENGTH_LONG).show(); + }else{ + Toast.makeText(getApplicationContext(), "Post enviado", Toast.LENGTH_LONG).show(); + } + finish(); + } + } + }); + } } } } diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/ThreadListAdapter.java b/app/src/main/java/org/bienvenidoainternet/baiparser/ThreadListAdapter.java index 69c674e..6a23280 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/ThreadListAdapter.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/ThreadListAdapter.java @@ -108,6 +108,7 @@ public class ThreadListAdapter extends ArrayAdapter{ SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this.getContext()); boolean useMonaFont = settings.getBoolean("setting_monafont", true); boolean monaBbsOnly = settings.getBoolean("setting_mona_bbsonly", true); + boolean resizeThumb = settings.getBoolean("setting_resize_thumbs", true); int marginColor = tm.getMarginColor(); int sageColor = tm.getSageColor(); int nameColor = tm.getNameColor(); @@ -126,12 +127,24 @@ public class ThreadListAdapter extends ArrayAdapter{ ImageView ivMargin = (ImageView)listItemView.findViewById(R.id.ivMargin); ImageView ivThumb = (ImageView)listItemView.findViewById(R.id.ivThumb); +// Log.v("resize", resizeThumb + ""); + if (resizeThumb){ + ivThumb.setScaleType(ImageView.ScaleType.FIT_XY); + }else{ + ivThumb.setScaleType(ImageView.ScaleType.FIT_CENTER); + } + ivThumb.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!boardItem.getThumb().isEmpty() && convertView != null){ - if (boardItem.getFile().endsWith(".webm") || boardItem.getFile().endsWith(".ogg") || boardItem.getFile().endsWith(".opus") || boardItem.getFile().endsWith(".swf")){ - Intent in = new Intent(Intent.ACTION_VIEW, Uri.parse("http://bienvenidoainternet.org/" + boardItem.getParentBoard().getBoardDir() + "/src/" + boardItem.getFile())); + if (boardItem.getFile().endsWith(".webm") || boardItem.getFile().endsWith(".ogg") || boardItem.getFile().endsWith(".opus") || boardItem.getFile().endsWith(".swf") || boardItem.youtubeLink){ + Intent in; + if (boardItem.youtubeLink){ + in = new Intent(Intent.ACTION_VIEW, Uri.parse(boardItem.youtubeURL)); + }else{ + in = new Intent(Intent.ACTION_VIEW, Uri.parse("http://bienvenidoainternet.org/" + boardItem.getParentBoard().getBoardDir() + "/src/" + boardItem.getFile())); + } in.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); v.getContext().startActivity(in); }else { @@ -244,14 +257,20 @@ public class ThreadListAdapter extends ArrayAdapter{ txtReplies.setText(boardItem.getTotalReplies() + " respuestas " + (boardItem.getTotalFiles() == 0 ? "" : ", " + boardItem.getTotalFiles() + " archivos")); String fileExt = ""; - if (!boardItem.getFile().isEmpty()){ - String[] pathSplit = boardItem.getFile().split("\\."); - if (pathSplit.length != 0){ - fileExt = pathSplit[1].toUpperCase(); + txtFileInfo.setVisibility(boardItem.getThumb().isEmpty() ? View.GONE : View.VISIBLE); + + if (!boardItem.getThumb().isEmpty() && boardItem.getThumb().startsWith("http")){ + txtFileInfo.setText("YOUTUBE"); + }else{ + if (!boardItem.getFile().isEmpty()){ + String[] pathSplit = boardItem.getFile().split("\\."); + if (pathSplit.length != 0){ + fileExt = pathSplit[1].toUpperCase(); + } } + txtFileInfo.setText(fileExt + " " + (boardItem.getFileSize() / 1024) + " KB " + boardItem.getThumbHeight() + "x" + boardItem.getThumbWidth()); } - txtFileInfo.setVisibility(boardItem.getThumb().isEmpty() ? View.GONE : View.VISIBLE); - txtFileInfo.setText(fileExt + " " + (boardItem.getFileSize() / 1024) + " KB " + boardItem.getThumbHeight() + "x" + boardItem.getThumbWidth()); + // Trasnparentar items con sage if (convertView != null){ diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/structure/Board.java b/app/src/main/java/org/bienvenidoainternet/baiparser/structure/Board.java index cb95e63..536f476 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/structure/Board.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/structure/Board.java @@ -24,16 +24,28 @@ import android.os.Parcelable; public class Board implements Parcelable{ private String boardName, boardDir; private int boardType; - public Board(String boardName,String boardDir,int boardType){ + + public boolean isCanAttachFiles() { + return canAttachFiles; + } + + public void setCanAttachFiles(boolean canAttachFiles) { + this.canAttachFiles = canAttachFiles; + } + + private boolean canAttachFiles; + public Board(String boardName, String boardDir, int boardType, boolean canAttachFiles){ this.boardName = boardName; this.boardDir = boardDir; this.boardType = boardType; + this.canAttachFiles = canAttachFiles; } public Board(Parcel in){ this.boardName = in.readString(); this.boardDir = in.readString(); this.boardType = in.readInt(); + this.canAttachFiles = in.readByte() != 0; } public String getBoardDir() { @@ -70,5 +82,6 @@ public class Board implements Parcelable{ dest.writeString(boardName); dest.writeString(boardDir); dest.writeInt(boardType); + dest.writeByte((byte)(canAttachFiles ? 1 : 0)); } } diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/structure/BoardItem.java b/app/src/main/java/org/bienvenidoainternet/baiparser/structure/BoardItem.java index b21d598..8eb55e5 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/structure/BoardItem.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/structure/BoardItem.java @@ -3,6 +3,12 @@ package org.bienvenidoainternet.baiparser.structure; import android.graphics.Bitmap; import android.os.Parcel; import android.os.Parcelable; +import android.util.Log; + +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.parser.Tag; /** * BaiApp - Bienvenido a internet Android Application @@ -31,12 +37,13 @@ public class BoardItem implements Parcelable { private String message = ""; private String subject = ""; private String posterId = ""; - private int parentid, id, idcolor, totalreplies = 0, totalfiles, thumb_height, thumb_weight, filesize, deleted_code, bbs_id = 1, parentPostCount; + public String youtubeURL = "", youtubeID = ""; + private int parentid = 0, id = 0, idcolor, totalreplies = 0, totalfiles, thumb_height, thumb_weight, filesize, deleted_code, bbs_id = 1, parentPostCount; private long timestamp = 0; private Bitmap thumbBitmap = null; public boolean downloadingThumb = false; - public boolean isReply = false; + public boolean isReply = false, isLocked = false, youtubeLink = false; private Board parentBoard = null; protected BoardItem(Parcel in) { @@ -49,6 +56,8 @@ public class BoardItem implements Parcelable { message = in.readString(); subject = in.readString(); posterId = in.readString(); + youtubeURL = in.readString(); + youtubeID = in.readString(); parentid = in.readInt(); id = in.readInt(); idcolor = in.readInt(); @@ -64,6 +73,8 @@ public class BoardItem implements Parcelable { thumbBitmap = in.readParcelable(Bitmap.class.getClassLoader()); downloadingThumb = in.readByte() != 0; isReply = in.readByte() != 0; + isLocked = in.readByte() != 0; + youtubeLink = in.readByte() != 0; parentBoard = in.readParcelable(Board.class.getClassLoader()); } @@ -124,12 +135,22 @@ public class BoardItem implements Parcelable { } public void setMessage(String message) { - // TODO: Dar formato a los mensajes de otra forma - this.message = message.replace("", ""); - this.message = this.message.replace("", ""); - if (this.message.contains("", "

") + ""; + Document msg = Jsoup.parse(message); + if (!msg.getElementsByClass("yt").isEmpty()){ + Element you = msg.getElementsByClass("yt").first(); + if (this.getFile().isEmpty()){ + this.thumb = you.getElementsByTag("img").attr("src"); + String[] parts = thumb.split("/"); + this.youtubeLink = true; + this.youtubeURL = "https://www.youtube.com/watch?v=" + parts[4]; + this.youtubeID = parts[4]; + Log.v("ID", youtubeID); + } } + msg.select("img[src]").remove(); + msg.select("span[class=unkfunc]").tagName("font").attr("color", "#8fb56c").wrap(""); + msg.select("div[class=yt]").wrap(""); + this.message = msg.html(); } public String getName() { @@ -288,6 +309,10 @@ public class BoardItem implements Parcelable { return this.email.equals("sage"); } + public void setLockStatus(int i){ + this.isLocked = i == 0 ? false : true; + } + @Override public int describeContents() { return 0; @@ -304,6 +329,8 @@ public class BoardItem implements Parcelable { dest.writeString(message); dest.writeString(subject); dest.writeString(posterId); + dest.writeString(youtubeURL); + dest.writeString(youtubeID); dest.writeInt(parentid); dest.writeInt(id); dest.writeInt(idcolor); @@ -319,6 +346,8 @@ public class BoardItem implements Parcelable { dest.writeParcelable(thumbBitmap, flags); dest.writeByte((byte) (downloadingThumb ? 1 : 0)); dest.writeByte((byte) (isReply ? 1 : 0)); + dest.writeByte((byte) (isLocked ? 1 : 0)); + dest.writeByte((byte) (youtubeLink ? 1 : 0)); dest.writeParcelable(parentBoard, flags); } } diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/structure/ReplyID.java b/app/src/main/java/org/bienvenidoainternet/baiparser/structure/ReplyID.java index 2780e74..9cf2319 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/structure/ReplyID.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/structure/ReplyID.java @@ -4,6 +4,8 @@ import android.graphics.Color; import android.os.Parcel; import android.os.Parcelable; +import org.bienvenidoainternet.baiparser.ThemeManager; + import java.util.Random; /** @@ -26,10 +28,14 @@ import java.util.Random; public class ReplyID implements Parcelable{ public String id; public int color; - public ReplyID(String id){ + public ReplyID(String id, ThemeManager tm){ this.id = id; Random r = new Random(); - this.color = Color.rgb(r.nextInt(125) + 127, r.nextInt(127) + 127, r.nextInt(127) + 127); + if (tm.isDarkTheme()){ + this.color = Color.rgb(r.nextInt(125) + 127, r.nextInt(127) + 127, r.nextInt(127) + 127); + }else{ + this.color = Color.rgb(r.nextInt(125), r.nextInt(127), r.nextInt(127)); + } } protected ReplyID(Parcel in) { diff --git a/app/src/main/res/drawable-hdpi/ic_action_add.png b/app/src/main/res/drawable-hdpi/ic_action_add.png new file mode 100644 index 0000000..7800ba3 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_add.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_action_font_underline.png b/app/src/main/res/drawable-hdpi/ic_action_font_underline.png new file mode 100644 index 0000000..7062cc7 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_font_underline.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_action_list_2.png b/app/src/main/res/drawable-hdpi/ic_action_list_2.png new file mode 100644 index 0000000..ac49d33 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_list_2.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_code.png b/app/src/main/res/drawable-hdpi/ic_code.png new file mode 100644 index 0000000..1b2f778 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_code.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_list_bulleted.png b/app/src/main/res/drawable-hdpi/ic_format_list_bulleted.png new file mode 100644 index 0000000..745283b Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_list_bulleted.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_strikethrough.png b/app/src/main/res/drawable-hdpi/ic_format_strikethrough.png new file mode 100644 index 0000000..2c1a2e1 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_strikethrough.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_format_underlined.png b/app/src/main/res/drawable-hdpi/ic_format_underlined.png new file mode 100644 index 0000000..1ac0ef2 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_format_underlined.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_add.png b/app/src/main/res/drawable-mdpi/ic_action_add.png new file mode 100644 index 0000000..ed40b2b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_add.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_font_underline.png b/app/src/main/res/drawable-mdpi/ic_action_font_underline.png new file mode 100644 index 0000000..cb18abb Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_font_underline.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_list_2.png b/app/src/main/res/drawable-mdpi/ic_action_list_2.png new file mode 100644 index 0000000..3397ab3 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_list_2.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_code.png b/app/src/main/res/drawable-mdpi/ic_code.png new file mode 100644 index 0000000..bbd2496 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_code.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_list_bulleted.png b/app/src/main/res/drawable-mdpi/ic_format_list_bulleted.png new file mode 100644 index 0000000..a49367b Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_list_bulleted.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_strikethrough.png b/app/src/main/res/drawable-mdpi/ic_format_strikethrough.png new file mode 100644 index 0000000..a836411 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_strikethrough.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_format_underlined.png b/app/src/main/res/drawable-mdpi/ic_format_underlined.png new file mode 100644 index 0000000..d8eb278 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_format_underlined.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_add.png b/app/src/main/res/drawable-xhdpi/ic_action_add.png new file mode 100644 index 0000000..185be8a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_add.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_font_underline.png b/app/src/main/res/drawable-xhdpi/ic_action_font_underline.png new file mode 100644 index 0000000..730ab79 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_font_underline.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_list_2.png b/app/src/main/res/drawable-xhdpi/ic_action_list_2.png new file mode 100644 index 0000000..319bbce Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_list_2.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_code.png b/app/src/main/res/drawable-xhdpi/ic_code.png new file mode 100644 index 0000000..42d620a Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_code.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_list_bulleted.png b/app/src/main/res/drawable-xhdpi/ic_format_list_bulleted.png new file mode 100644 index 0000000..0b10898 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_list_bulleted.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_strikethrough.png b/app/src/main/res/drawable-xhdpi/ic_format_strikethrough.png new file mode 100644 index 0000000..7cd4f13 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_strikethrough.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_format_underlined.png b/app/src/main/res/drawable-xhdpi/ic_format_underlined.png new file mode 100644 index 0000000..32c0140 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_format_underlined.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_add.png b/app/src/main/res/drawable-xxhdpi/ic_action_add.png new file mode 100644 index 0000000..2ab780a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_add.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_font_underline.png b/app/src/main/res/drawable-xxhdpi/ic_action_font_underline.png new file mode 100644 index 0000000..1bb40b5 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_font_underline.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_list_2.png b/app/src/main/res/drawable-xxhdpi/ic_action_list_2.png new file mode 100644 index 0000000..a71d22c Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_list_2.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_code.png b/app/src/main/res/drawable-xxhdpi/ic_code.png new file mode 100644 index 0000000..65972be Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_code.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_list_bulleted.png b/app/src/main/res/drawable-xxhdpi/ic_format_list_bulleted.png new file mode 100644 index 0000000..5a7b70e Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_list_bulleted.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_strikethrough.png b/app/src/main/res/drawable-xxhdpi/ic_format_strikethrough.png new file mode 100644 index 0000000..6b46c34 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_strikethrough.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_format_underlined.png b/app/src/main/res/drawable-xxhdpi/ic_format_underlined.png new file mode 100644 index 0000000..8724f59 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_format_underlined.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_add.png b/app/src/main/res/drawable-xxxhdpi/ic_action_add.png new file mode 100644 index 0000000..e6ca376 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_action_add.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_font_underline.png b/app/src/main/res/drawable-xxxhdpi/ic_action_font_underline.png new file mode 100644 index 0000000..f941ab2 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_action_font_underline.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_list_2.png b/app/src/main/res/drawable-xxxhdpi/ic_action_list_2.png new file mode 100644 index 0000000..7746bf2 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_action_list_2.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_code.png b/app/src/main/res/drawable-xxxhdpi/ic_code.png new file mode 100644 index 0000000..fae84b5 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_code.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted.png b/app/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted.png new file mode 100644 index 0000000..21bd897 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_list_bulleted.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_strikethrough.png b/app/src/main/res/drawable-xxxhdpi/ic_format_strikethrough.png new file mode 100644 index 0000000..1e9e4a1 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_strikethrough.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_format_underlined.png b/app/src/main/res/drawable-xxxhdpi/ic_format_underlined.png new file mode 100644 index 0000000..afabe85 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_format_underlined.png differ diff --git a/app/src/main/res/drawable/Thumbs.db b/app/src/main/res/drawable/Thumbs.db index 07c6d5a..7a924fe 100644 Binary files a/app/src/main/res/drawable/Thumbs.db and b/app/src/main/res/drawable/Thumbs.db differ diff --git a/app/src/main/res/layout/activity_response.xml b/app/src/main/res/layout/activity_response.xml index 15d35eb..2bae1d6 100644 --- a/app/src/main/res/layout/activity_response.xml +++ b/app/src/main/res/layout/activity_response.xml @@ -14,82 +14,144 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/layoutForm"> + + + +