Skip to content

Commit

Permalink
renamed id resources
Browse files Browse the repository at this point in the history
  • Loading branch information
DevEmperor committed Oct 1, 2024
1 parent 95e4079 commit 92157b7
Show file tree
Hide file tree
Showing 45 changed files with 136 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);

TextView aboutText = findViewById(R.id.version_tv);
TextView aboutText = findViewById(R.id.activity_about_version_tv);
aboutText.setText(getString(R.string.wristassist_about, BuildConfig.VERSION_NAME));

ImageView icon = findViewById(R.id.icon);
ImageView icon = findViewById(R.id.activity_about_icon_iv);
icon.setOnLongClickListener(v -> {
Toast.makeText(v.getContext(), getSharedPreferences("net.devemperor.wristassist", MODE_PRIVATE)
.getString("net.devemperor.wristassist.userid", "null"), Toast.LENGTH_LONG).show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_changelog);

changelogSv = findViewById(R.id.changelog_sv);
changelogTv = findViewById(R.id.changelog_tv);
changelogSv = findViewById(R.id.activity_changelog_sv);
changelogTv = findViewById(R.id.activity_changelog_content_tv);

SharedPreferences sp = getSharedPreferences("net.devemperor.wristassist", MODE_PRIVATE);
Markwon markwon = Markwon.builder(this).usePlugin(HtmlPlugin.create()).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_chat);

chatAdapter = new ChatAdapter(this, new ArrayList<>());
chatLv = findViewById(R.id.chat_lv);
chatLv = findViewById(R.id.activity_chat_lv);

chatLv.setAdapter(chatAdapter);
View footerView = LayoutInflater.from(this).inflate(R.layout.layout_chat_footer, chatLv, false);
chatLv.addFooterView(footerView);
View headerView = LayoutInflater.from(this).inflate(R.layout.layout_chat_header, chatLv, false);
chatLv.addHeaderView(headerView);
progressBar = footerView.findViewById(R.id.progress_bar);
askBtn = footerView.findViewById(R.id.ask_btn);
saveResetBtn = footerView.findViewById(R.id.save_btn);
errorTv = footerView.findViewById(R.id.error_tv);
titleTv = headerView.findViewById(R.id.title_tv);
progressBar = footerView.findViewById(R.id.layout_chat_footer_pb);
askBtn = footerView.findViewById(R.id.layout_chat_footer_ask_btn);
saveResetBtn = footerView.findViewById(R.id.layout_chat_footer_save_btn);
errorTv = footerView.findViewById(R.id.layout_chat_footer_error_tv);
titleTv = headerView.findViewById(R.id.layout_chat_header_title_tv);

vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ protected void onCreate(Bundle savedInstanceState) {
service = new OpenAiService(api);
vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);

createImageSv = findViewById(R.id.create_image_sv);
imagePb = findViewById(R.id.image_pb);
errorTv = findViewById(R.id.error_image_tv);
retryBtn = findViewById(R.id.retry_image_btn);
imageView = findViewById(R.id.create_image_iv);
shareBtn = findViewById(R.id.share_image_btn);
expiresInTv = findViewById(R.id.expires_image_tv);
saveDiscardBtns = findViewById(R.id.save_discard_image_btns);
createImageSv = findViewById(R.id.activity_create_image_sv);
imagePb = findViewById(R.id.activity_create_image_pb);
errorTv = findViewById(R.id.activity_create_image_error_tv);
retryBtn = findViewById(R.id.activity_create_image_retry_btn);
imageView = findViewById(R.id.activity_create_image_image_zv);
shareBtn = findViewById(R.id.activity_create_image_share_btn);
expiresInTv = findViewById(R.id.activity_create_image_expires_tv);
saveDiscardBtns = findViewById(R.id.activity_create_image_save_discard_btns);

prompt = getIntent().getStringExtra("net.devemperor.wristassist.prompt");
model = sp.getBoolean("net.devemperor.wristassist.image_model", false) ? "dall-e-3" : "dall-e-2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_chat);

editChatSv = findViewById(R.id.edit_chat_sv);
titleTv = findViewById(R.id.edit_title_tv);
modifiedTv = findViewById(R.id.modified_tv);
chatCostTv = findViewById(R.id.chat_cost_tv);
editTitleBtn = findViewById(R.id.edit_btn);
deleteChatBtn = findViewById(R.id.delete_btn);
editChatSv = findViewById(R.id.activity_edit_chat_sv);
titleTv = findViewById(R.id.activity_edit_chat_title_tv);
modifiedTv = findViewById(R.id.activity_edit_chat_modified_tv);
chatCostTv = findViewById(R.id.activity_edit_chat_cost_tv);
editTitleBtn = findViewById(R.id.activity_edit_chat_edit_btn);
deleteChatBtn = findViewById(R.id.activity_edit_chat_delete_btn);

chatHistoryDatabaseHelper = new ChatHistoryDatabaseHelper(this);
id = getIntent().getLongExtra("net.devemperor.wristassist.chatId", -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected void onCreate(Bundle savedInstanceState) {

imagesDatabaseHelper = new ImagesDatabaseHelper(this);

galleryWrv = findViewById(R.id.gallery_wrv);
galleryWrv = findViewById(R.id.activity_image_gallery_wrv);
galleryWrv.setEdgeItemsCenteringEnabled(true);
galleryWrv.setHasFixedSize(true);
galleryWrv.setLayoutManager(new GridLayoutManager(this, 3));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_input);

inputSv = findViewById(R.id.input_sv);
inputSv = findViewById(R.id.activity_input_sv);

String title = getIntent().getStringExtra("net.devemperor.wristassist.input.title");
String content = getIntent().getStringExtra("net.devemperor.wristassist.input.content");
Expand All @@ -39,10 +39,10 @@ protected void onCreate(Bundle savedInstanceState) {
String content2 = getIntent().getStringExtra("net.devemperor.wristassist.input.content2");
String hint2 = getIntent().getStringExtra("net.devemperor.wristassist.input.hint2");
boolean handsFree = getIntent().getBooleanExtra("net.devemperor.wristassist.input.hands_free", false);
inputTitleTv = findViewById(R.id.input_title_tv);
inputContentEt = findViewById(R.id.input_content_et);
inputTitle2Tv = findViewById(R.id.input_title2_tv);
inputContent2Et = findViewById(R.id.input_content2_et);
inputTitleTv = findViewById(R.id.activity_input_title_tv);
inputContentEt = findViewById(R.id.activity_input_content_et);
inputTitle2Tv = findViewById(R.id.activity_input_title2_tv);
inputContent2Et = findViewById(R.id.activity_input_content2_et);
inputTitleTv.setText(title);
inputContentEt.setText(content);
inputContentEt.setHint(hint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mainWrv = findViewById(R.id.main_wrv);
mainPb = findViewById(R.id.main_pb);
mainWrv = findViewById(R.id.activity_main_wrv);
mainPb = findViewById(R.id.activity_main_pb);

mainWrv.setHasFixedSize(true);
mainWrv.setEdgeItemsCenteringEnabled(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_onboarding);

onboardingVp = findViewById(R.id.onboarding_viewpager);
onboardingTl = findViewById(R.id.onboarding_tablayout);
onboardingVp = findViewById(R.id.activity_onboarding_vp);
onboardingTl = findViewById(R.id.activity_onboarding_tl);
onboardingVp.setAdapter(new OnboardingAdapter(this, new int[]{
R.layout.viewpager_welcome,
R.layout.viewpager_info,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ protected void onCreate(Bundle savedInstanceState) {
imageModel = imagesDatabaseHelper.get(imageId);

openImageSv = findViewById(R.id.open_image_sv);
imageView = findViewById(R.id.open_image_iv);
shareBtn = findViewById(R.id.share_image_btn);
expiresInTv = findViewById(R.id.expires_image_tv);
imageView = findViewById(R.id.item_gallery_image_zv);
shareBtn = findViewById(R.id.activity_create_image_share_btn);
expiresInTv = findViewById(R.id.activity_create_image_expires_tv);
promptTv = findViewById(R.id.open_image_prompt_tv);
revisedPromptTv = findViewById(R.id.open_image_revised_prompt_tv);
modelTv = findViewById(R.id.open_image_model_tv);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected void onCreate(Bundle savedInstanceState) {

String imageUrl = getIntent().getStringExtra("net.devemperor.wristassist.image_url");

ImageView qrCodeIv = findViewById(R.id.qrcode_iv);
ImageView qrCodeIv = findViewById(R.id.viewpager_onboarding_qrcode_iv);

Bitmap code = QRCode.from(imageUrl)
.withSize(256, 256)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_saved_chats);

savedChatsWrv = findViewById(R.id.saved_chats_wrv);
savedChatsWrv = findViewById(R.id.activity_saved_chats_wrv);
savedChatsWrv.setHasFixedSize(true);
savedChatsWrv.setEdgeItemsCenteringEnabled(true);
savedChatsWrv.setLayoutManager(new WearableLinearLayoutManager(this));
Expand All @@ -53,7 +53,7 @@ protected void onCreate(Bundle savedInstanceState) {
});
savedChatsWrv.setAdapter(savedChatsAdapter);

TextView noSavedChats = findViewById(R.id.no_saved_chats);
TextView noSavedChats = findViewById(R.id.activity_saved_chats_no_saved_chats_tv);
noSavedChats.setVisibility(chats.isEmpty() ? android.view.View.VISIBLE : android.view.View.GONE);

savedChatsWrv.requestFocus();
Expand All @@ -73,7 +73,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 1337 && data.getBooleanExtra("net.devemperor.wristassist.chat_deleted", false)) {
savedChatsAdapter.getData().remove(currentEditPosition);
savedChatsAdapter.notifyItemRemoved(currentEditPosition);
findViewById(R.id.no_saved_chats).setVisibility(savedChatsAdapter.getData().isEmpty() ? android.view.View.VISIBLE : android.view.View.GONE);
findViewById(R.id.activity_saved_chats_no_saved_chats_tv).setVisibility(savedChatsAdapter.getData().isEmpty() ? android.view.View.VISIBLE : android.view.View.GONE);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected void onCreate(Bundle savedInstanceState) {

getSupportFragmentManager()
.beginTransaction()
.replace(R.id.activity_settings, new PreferencesFragment())
.replace(R.id.activity_settings_ll, new PreferencesFragment())
.commit();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ protected void onCreate(Bundle savedInstanceState) {

usageDatabaseHelper = new UsageDatabaseHelper(this);
usageAdapter = new UsageAdapter(this, usageDatabaseHelper.getAll());
usageLv = findViewById(R.id.usage_lv);
usageLv = findViewById(R.id.activity_usage_lv);
usageLv.setAdapter(usageAdapter);

View footerView = LayoutInflater.from(this).inflate(R.layout.layout_usage_footer, usageLv, false);
resetUsageBtn = footerView.findViewById(R.id.usage_reset_btn);
resetUsageBtn = footerView.findViewById(R.id.layout_usage_footer_reset_btn);

totalCostTv = footerView.findViewById(R.id.usage_total_cost_tv);
totalCostTv = footerView.findViewById(R.id.layout_usage_footer_total_cost_tv);
totalCostTv.setText(getString(R.string.wristassist_total_cost,
String.format(Locale.getDefault(), "%,.2f", usageDatabaseHelper.getTotalCost())));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void shutdownServices() {
public View getView (int position, View convertView, @NonNull ViewGroup parent) {
View listItem = LayoutInflater.from(context).inflate(R.layout.item_chat, parent, false);

TextView chatItem = listItem.findViewById(R.id.chat_item_text);
TextView chatItem = listItem.findViewById(R.id.item_chat_content_tv);
chatItem.setTextSize(context.getSharedPreferences("net.devemperor.wristassist", Context.MODE_PRIVATE)
.getInt("net.devemperor.wristassist.font_size", 15));

Expand Down Expand Up @@ -124,7 +124,7 @@ public View getView (int position, View convertView, @NonNull ViewGroup parent)
long totalCost = objects.get(position).getTotalCost();
if (totalCost > 0 && context.getSharedPreferences("net.devemperor.wristassist", Context.MODE_PRIVATE)
.getBoolean("net.devemperor.wristassist.show_cost", false)) {
TextView chatItemCost = listItem.findViewById(R.id.chat_item_cost);
TextView chatItemCost = listItem.findViewById(R.id.item_chat_cost_tv);
chatItemCost.setText(df.format(totalCost / 1000.0) + " k");
chatItemCost.setVisibility(View.VISIBLE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static class RecyclerViewHolder extends RecyclerView.ViewHolder {

public RecyclerViewHolder(View view) {
super(view);
image = view.findViewById(R.id.open_image_iv);
image = view.findViewById(R.id.item_gallery_image_zv);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public static class RecyclerViewHolder extends RecyclerView.ViewHolder {

public RecyclerViewHolder(View view) {
super(view);
menuContainer = view.findViewById(R.id.menu_container);
menuItem = view.findViewById(R.id.menu_text);
menuIcon = view.findViewById(R.id.menu_icon);
menuContainer = view.findViewById(R.id.item_main_rl);
menuItem = view.findViewById(R.id.item_main_content_tv);
menuIcon = view.findViewById(R.id.item_main_icon_iv);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
if (position == 2) {
ImageView qrCodeIv = holder.itemView.findViewById(R.id.qrcode_iv);
ImageView qrCodeIv = holder.itemView.findViewById(R.id.viewpager_onboarding_qrcode_iv);
qrCodeIv.setOnClickListener(v -> {
Intent intent = new Intent(v.getContext(), MainActivity.class);
intent.putExtra("net.devemperor.wristassist.enter_api_key", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public static class RecyclerViewHolder extends RecyclerView.ViewHolder {

public RecyclerViewHolder(View view) {
super(view);
savedChatContainer = view.findViewById(R.id.saved_chat_container);
savedChatTitle = view.findViewById(R.id.saved_chat_title);
savedChatContainer = view.findViewById(R.id.item_saved_chat_ll);
savedChatTitle = view.findViewById(R.id.item_saved_chat_title_tv);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public View getView (int position, View convertView, @NonNull ViewGroup parent)

UsageModel dataProvider = objects.get(position);

TextView modelNameTv = listItem.findViewById(R.id.usage_model_tv);
TextView modelNameTv = listItem.findViewById(R.id.item_usage_model_tv);
modelNameTv.setText(WristAssistUtil.translate(context, dataProvider.getModelName()));

TextView tokensTv = listItem.findViewById(R.id.usage_tokens_tv);
TextView tokensTv = listItem.findViewById(R.id.item_usage_tokens_tv);
if (dataProvider.getModelName().startsWith("gpt")) {
tokensTv.setText(context.getString(R.string.wristassist_token_usage,
String.format(Locale.getDefault(), "%,d", dataProvider.getTokens())));
Expand All @@ -46,7 +46,7 @@ public View getView (int position, View convertView, @NonNull ViewGroup parent)
String.format(Locale.getDefault(), "%,d", dataProvider.getTokens())));
}

TextView costTv = listItem.findViewById(R.id.usage_cost_tv);
TextView costTv = listItem.findViewById(R.id.item_usage_cost_tv);
costTv.setText(context.getString(R.string.wristassist_estimated_cost,
String.format(Locale.getDefault(), "%,.2f", dataProvider.getCost())));

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
app:layout_boxedEdges="all">

<ImageView
android:id="@+id/icon"
android:id="@+id/activity_about_icon_iv"
android:layout_width="72dp"
android:layout_height="72dp"
android:background="@drawable/wristassist_logo"
app:layout_constraintBottom_toTopOf="@+id/version_tv"
app:layout_constraintBottom_toTopOf="@+id/activity_about_version_tv"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/version_tv"
android:id="@+id/activity_about_version_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/wristassist_about"
Expand All @@ -33,7 +33,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/icon" />
app:layout_constraintTop_toBottomOf="@+id/activity_about_icon_iv" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.wear.widget.BoxInsetLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/activity_changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
android:orientation="vertical"
android:paddingHorizontal="12dp"
android:fillViewport="false"
android:id="@+id/changelog_sv">
android:id="@+id/activity_changelog_sv">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/changelog_tv"
android:id="@+id/activity_changelog_content_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="48dp" />

<Button
android:id="@+id/changelog_ok_btn"
android:id="@+id/activity_changelog_ok_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="32dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_chat.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ListView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/chat_lv"
android:id="@+id/activity_chat_lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
Expand Down
Loading

0 comments on commit 92157b7

Please sign in to comment.