From 00cfbfc1cd3bec581fb81722826407d07ad7d83c Mon Sep 17 00:00:00 2001 From: Renard Date: Thu, 14 Apr 2016 17:16:18 -0300 Subject: Test --- .../main/java/layout/FragmentBoardItemList.java | 2 +- app/src/main/java/layout/FragmentImage.java | 2 +- .../baiparser/MainActivity.java | 3 +-- .../baiparser/ResponseActivity.java | 23 +++++++++++++--------- .../baiparser/ThreadListAdapter.java | 2 +- .../main/res/layout/fragment_fragment_image.xml | 2 +- app/src/main/res/values/styles.xml | 4 ++-- 7 files changed, 21 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/layout/FragmentBoardItemList.java b/app/src/main/java/layout/FragmentBoardItemList.java index 6095a86..5bac6e9 100644 --- a/app/src/main/java/layout/FragmentBoardItemList.java +++ b/app/src/main/java/layout/FragmentBoardItemList.java @@ -315,7 +315,7 @@ public class FragmentBoardItemList extends Fragment { Intent in = new Intent(getActivity().getApplicationContext(), ResponseActivity.class); Bundle b = new Bundle(); b.putParcelable("theReply", boardItems.get(info.position)); - b.putParcelable("theBoard", currentBoard); + b.putBoolean("quoting", true); in.putExtras(b); getActivity().startActivity(in); break; diff --git a/app/src/main/java/layout/FragmentImage.java b/app/src/main/java/layout/FragmentImage.java index f337e5f..eb2471b 100644 --- a/app/src/main/java/layout/FragmentImage.java +++ b/app/src/main/java/layout/FragmentImage.java @@ -83,7 +83,7 @@ public class FragmentImage extends Fragment { gifView.setVisibility(View.GONE); RelativeLayout layoutOpenBrowser = (RelativeLayout) view.findViewById(R.id.layoutOpenBrowser); if (boardItemFile.file != null) { - if (!boardItemFile.file.endsWith(".webm") && !boardItemFile.file.endsWith(".swf")) { + if (!boardItemFile.file.endsWith(".webm") && !boardItemFile.file.endsWith(".swf") && !boardItemFile.file.endsWith(".ogg") && !boardItemFile.file.endsWith(".opus")) { layoutOpenBrowser.setVisibility(View.GONE); downloadFile(); }else{ diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java b/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java index 4a6f2c4..45b30e5 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java @@ -108,7 +108,7 @@ public class MainActivity extends AppCompatActivity Intent in = new Intent(getApplicationContext(), ResponseActivity.class); Bundle b = new Bundle(); b.putParcelable("theReply", childFragment.boardItems.get(0)); - b.putParcelable("theBoard", childFragment.currentBoard); + b.putBoolean("quoting", false); in.putExtras(b); startActivity(in); } catch (Exception e) { @@ -194,7 +194,6 @@ public class MainActivity extends AppCompatActivity } } - //merge test hola, no se ocupar git ww @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/ResponseActivity.java b/app/src/main/java/org/bienvenidoainternet/baiparser/ResponseActivity.java index 350de99..e760926 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/ResponseActivity.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/ResponseActivity.java @@ -33,11 +33,11 @@ import utils.ContentProviderUtils; public class ResponseActivity extends AppCompatActivity { private BoardItem theReply = null; - private Board currentBoard = null; private SharedPreferences settings; private String password; private String selectedFile = ""; private final int PICK_IMAGE = 1; + private boolean quoting = false; EditText filePath; @Override @@ -52,14 +52,19 @@ public class ResponseActivity extends AppCompatActivity { if (savedInstanceState != null){ this.theReply = savedInstanceState.getParcelable("theReply"); - this.currentBoard = savedInstanceState.getParcelable("theBoard"); + this.quoting = savedInstanceState.getBoolean("quoting"); } if (getIntent().getExtras() != null){ this.theReply = getIntent().getParcelableExtra("theReply"); - this.currentBoard = getIntent().getParcelableExtra("theBoard"); + this.quoting = getIntent().getBooleanExtra("quoting", false); } - if (theReply != null && currentBoard != null){ - System.out.println(theReply.getId() + " " + theReply.getName()); + if (theReply != null && quoting){ + TextView txtMessage = (TextView) findViewById(R.id.txtResponse); + if (theReply.getParentBoard().getBoardType() == 1){ // BBS + txtMessage.setText(">>" + theReply.getBbsId()); + }else{ + txtMessage.setText(">>" + theReply.getId()); + } } LinearLayout layoutProcess = (LinearLayout)findViewById(R.id.layoutPostProcess); @@ -163,7 +168,7 @@ public class ResponseActivity extends AppCompatActivity { .load("http://bienvenidoainternet.org/cgi/post") .setLogging("posting", Log.VERBOSE) .uploadProgressBar(progess) - .setMultipartParameter("board", currentBoard.getBoardDir()) + .setMultipartParameter("board", theReply.getParentBoard().getBoardDir()) .setMultipartParameter("parent", String.valueOf(theReply.realParentId())) .setMultipartParameter("password", password) .setMultipartParameter("fielda", name) @@ -176,12 +181,12 @@ public class ResponseActivity extends AppCompatActivity { @Override public void onCompleted(Exception e, String result) { Log.v("sendPost", result); - if (e != null){ + 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{ + } else { Toast.makeText(getApplicationContext(), "Post enviado", Toast.LENGTH_LONG).show(); finish(); } @@ -191,7 +196,7 @@ public class ResponseActivity extends AppCompatActivity { Ion.with(getApplicationContext()) .load("http://bienvenidoainternet.org/cgi/post") .uploadProgressBar(progess) - .setMultipartParameter("board", currentBoard.getBoardDir()) + .setMultipartParameter("board", theReply.getParentBoard().getBoardDir()) .setMultipartParameter("parent", String.valueOf(parentId)) .setMultipartParameter("password", password) .setMultipartParameter("fielda", name) diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/ThreadListAdapter.java b/app/src/main/java/org/bienvenidoainternet/baiparser/ThreadListAdapter.java index 7a85c1f..791497c 100644 --- a/app/src/main/java/org/bienvenidoainternet/baiparser/ThreadListAdapter.java +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/ThreadListAdapter.java @@ -115,7 +115,7 @@ public class ThreadListAdapter extends ArrayAdapter{ @Override public void onClick(View v) { if (!boardItem.getThumb().isEmpty() && convertView != null){ - if (boardItem.getFile().endsWith(".webm")){ + 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())); in.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); v.getContext().startActivity(in); diff --git a/app/src/main/res/layout/fragment_fragment_image.xml b/app/src/main/res/layout/fragment_fragment_image.xml index 5d44190..170183a 100644 --- a/app/src/main/res/layout/fragment_fragment_image.xml +++ b/app/src/main/res/layout/fragment_fragment_image.xml @@ -24,7 +24,7 @@