Skip to content

Commit

Permalink
removed unnecessary "show cost" option
Browse files Browse the repository at this point in the history
  • Loading branch information
DevEmperor committed Oct 2, 2024
1 parent 2e48cdc commit cddf262
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import net.devemperor.wristassist.items.ChatItem;
import net.devemperor.wristassist.util.WristAssistUtil;

import java.text.DecimalFormat;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
Expand All @@ -48,7 +47,6 @@ public class ChatAdapter extends ArrayAdapter<ChatItem> {

TextToSpeech tts;
LanguageIdentifier langId;
DecimalFormat df = new DecimalFormat("#.#");
boolean showSystemMessage = false;
boolean ttsEnabled = false;
String lastText = "";
Expand Down Expand Up @@ -123,12 +121,6 @@ public View getView (int position, View convertView, @NonNull ViewGroup parent)
assert icon != null;
setLeadingMarginSpan(chatItem, icon);

long totalCost = objects.get(position).getTotalCost();
if (totalCost > 0 && sp.getBoolean("net.devemperor.wristassist.show_cost", false)) {
TextView chatItemCost = listItem.findViewById(R.id.item_chat_cost_tv);
chatItemCost.setText(df.format(totalCost / 1000.0) + " k");
chatItemCost.setVisibility(View.VISIBLE);
}
return listItem;
}

Expand Down
14 changes: 1 addition & 13 deletions app/src/main/res/layout/item_chat.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/item_chat_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -15,14 +13,4 @@
android:layout_alignParentTop="true"
android:layout_marginHorizontal="8dp"
android:textSize="15sp"/>

<TextView
android:id="@+id/item_chat_cost_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/item_chat_content_tv"
android:layout_alignParentEnd="true"
android:textStyle="italic"
android:visibility="gone"
tools:visibility="visible"/>
</RelativeLayout>
5 changes: 0 additions & 5 deletions app/src/main/res/xml/fragment_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
app:title="@string/wristassist_vibrate"
android:defaultValue="true"/>

<SwitchPreference
app:key="net.devemperor.wristassist.show_cost"
app:title="@string/wristassist_show_cost"
android:defaultValue="false"/>

</PreferenceCategory>

<PreferenceCategory
Expand Down

0 comments on commit cddf262

Please sign in to comment.