From 22e5b86dcf7bd8e20abf7ab0de197a29f77e78d7 Mon Sep 17 00:00:00 2001 From: Renard Date: Sun, 8 May 2016 17:47:07 -0300 Subject: 1.8 --- .../main/java/org/bienvenidoainternet/app/MainActivity.java | 10 +++++++++- .../java/org/bienvenidoainternet/app/ResponseActivity.java | 8 ++++++++ .../main/java/org/bienvenidoainternet/app/ThemeManager.java | 5 +++++ .../java/org/bienvenidoainternet/app/ThreadListAdapter.java | 5 ++++- .../java/org/bienvenidoainternet/app/structure/BoardItem.java | 3 ++- 5 files changed, 28 insertions(+), 3 deletions(-) (limited to 'app/src/main/java/org') diff --git a/app/src/main/java/org/bienvenidoainternet/app/MainActivity.java b/app/src/main/java/org/bienvenidoainternet/app/MainActivity.java index 0d266fc..3a1890e 100644 --- a/app/src/main/java/org/bienvenidoainternet/app/MainActivity.java +++ b/app/src/main/java/org/bienvenidoainternet/app/MainActivity.java @@ -14,10 +14,12 @@ import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; +import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.SubMenu; import android.view.View; +import android.view.Window; import android.widget.BaseAdapter; import android.widget.HeaderViewListAdapter; import android.widget.ListView; @@ -93,7 +95,9 @@ public class MainActivity extends AppCompatActivity @Override protected void onCreate(Bundle savedInstanceState) { + getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); super.onCreate(savedInstanceState); + Ion.getDefault(getApplicationContext()).configure().setLogging("IonLog", Log.DEBUG); ThemeManager tm = new ThemeManager(this); this.setTheme(tm.getThemeForMainActivity()); @@ -231,7 +235,7 @@ public class MainActivity extends AppCompatActivity } if (tm.isDarkTheme()){ - navigationView.setBackgroundColor(0xFF888888); +// navigationView.setBackgroundColor(0xFF888888); } } @@ -437,6 +441,10 @@ public class MainActivity extends AppCompatActivity sub.add(parsedBoard.getBoardName()); boardList.add(parsedBoard); } +// Board polka = new Board("Testing", "polka", 0, true); +// boardList.add(polka); +// sub.add("Testing"); + }catch (JSONException e1) { Toast.makeText(getApplicationContext(), e1.getMessage(), Toast.LENGTH_LONG).show(); e1.printStackTrace(); diff --git a/app/src/main/java/org/bienvenidoainternet/app/ResponseActivity.java b/app/src/main/java/org/bienvenidoainternet/app/ResponseActivity.java index 74ac04b..3e74573 100644 --- a/app/src/main/java/org/bienvenidoainternet/app/ResponseActivity.java +++ b/app/src/main/java/org/bienvenidoainternet/app/ResponseActivity.java @@ -113,6 +113,14 @@ public class ResponseActivity extends AppCompatActivity { Button bItalic = (Button) findViewById(R.id.buttonItalic); Button select = (Button) findViewById(R.id.btnSelectFiles); + bBold.setVisibility(View.GONE); + bStrike.setVisibility(View.GONE); + bList.setVisibility(View.GONE); + bCode.setVisibility(View.GONE); + bUnder.setVisibility(View.GONE); + bItalic.setVisibility(View.GONE); + + bBold.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/app/src/main/java/org/bienvenidoainternet/app/ThemeManager.java b/app/src/main/java/org/bienvenidoainternet/app/ThemeManager.java index 04ed3fd..3c6722d 100644 --- a/app/src/main/java/org/bienvenidoainternet/app/ThemeManager.java +++ b/app/src/main/java/org/bienvenidoainternet/app/ThemeManager.java @@ -137,4 +137,9 @@ public class ThemeManager { public int getCurrentThemeId() { return currentThemeId; } + + public int getQuoteColor() { + TypedArray a = activity.getTheme().obtainStyledAttributes(currentThemeId, new int[]{R.attr.quoteColor}); + return a.getColor(0, Color.CYAN); + } } diff --git a/app/src/main/java/org/bienvenidoainternet/app/ThreadListAdapter.java b/app/src/main/java/org/bienvenidoainternet/app/ThreadListAdapter.java index d5f8a71..4e6e9cb 100644 --- a/app/src/main/java/org/bienvenidoainternet/app/ThreadListAdapter.java +++ b/app/src/main/java/org/bienvenidoainternet/app/ThreadListAdapter.java @@ -113,10 +113,12 @@ public class ThreadListAdapter extends ArrayAdapter{ int sageColor = tm.getSageColor(); int nameColor = tm.getNameColor(); int tripcodeColor = tm.getTripcodeColor(); + int quoteColor = tm.getQuoteColor(); String hexColor =intToHexString(boardItem.getIdColor()); String sageHexColor = intToHexString(sageColor); String nameHexColor = intToHexString(nameColor); String tripcodeHexColor = intToHexString(tripcodeColor); + String quoteHexColor = intToHexString(quoteColor); String strId = ""; TextView txtTitle = (TextView)listItemView.findViewById(R.id.lv_txtTitle); @@ -251,7 +253,8 @@ public class ThreadListAdapter extends ArrayAdapter{ txtPoster.setText(Html.fromHtml("No. " + idToDisplay + " por " + boardItem.getName() + " " + (boardItem.getTripcode() == "" ? "" : "" + boardItem.getTripcode() + "") + strId + " " + strTimeDiff)); - txtBody.setText(Html.fromHtml(boardItem.getMessage())); + String fixedMessage = boardItem.getMessage().replace("$_QUOTECOLOR_$", quoteHexColor); + txtBody.setText(Html.fromHtml(fixedMessage)); txtReplies.setVisibility(boardItem.isReply ? View.GONE : View.VISIBLE); txtReplies.setText(boardItem.getTotalReplies() + " respuestas " + (boardItem.getTotalFiles() == 0 ? "" : ", " + boardItem.getTotalFiles() + " archivos")); diff --git a/app/src/main/java/org/bienvenidoainternet/app/structure/BoardItem.java b/app/src/main/java/org/bienvenidoainternet/app/structure/BoardItem.java index 9b81e8b..7a7cb02 100644 --- a/app/src/main/java/org/bienvenidoainternet/app/structure/BoardItem.java +++ b/app/src/main/java/org/bienvenidoainternet/app/structure/BoardItem.java @@ -5,6 +5,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.util.Log; +import org.bienvenidoainternet.app.ThemeManager; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; @@ -147,7 +148,7 @@ public class BoardItem implements Parcelable { } } msg.select("img[src]").remove(); - msg.select("span[class=unkfunc]").tagName("font").attr("color", "#8fb56c").wrap(""); + msg.select("span[class=unkfunc]").tagName("font").attr("color", "$_QUOTECOLOR_$").wrap(""); msg.select("div[class=yt]").wrap(""); this.message = msg.html(); } -- cgit v1.2.1-18-gbd029