Skip to content

Commit

Permalink
fix: settings cannot get right key
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Feb 15, 2024
1 parent 8b14fd8 commit 2118261
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,20 @@ public class NekoChatSettingsActivity extends BaseNekoXSettingsActivity implemen
private UndoView tooltip;

public NekoChatSettingsActivity() {
if (!NekoXConfig.isDeveloper()) {
cellGroup.rows.remove(disableChatActionRow);
cellGroup.rows.remove(disableChoosingStickerRow);
cellGroup.rows.remove(ignoreBlockedRow);
cellGroup.rows.remove(dividerEnd);
NekoConfig.disableChatAction.setConfigBool(false);
NekoConfig.disableChoosingSticker.setConfigBool(false);
NekoConfig.ignoreBlocked.setConfigBool(false);
}
if (!NekoConfig.showRepeat.Bool() || NaConfig.INSTANCE.getShowRepeatAsCopy().Bool()){
cellGroup.rows.remove(autoReplaceRepeatRow);
NaConfig.INSTANCE.getAutoReplaceRepeat().setConfigBool(false);
}

addRowsToMap(cellGroup);
}

Expand Down Expand Up @@ -251,21 +265,6 @@ public void onItemClick(int id) {
}
});

// Before listAdapter
if (!NekoXConfig.isDeveloper()) {
cellGroup.rows.remove(disableChatActionRow);
cellGroup.rows.remove(disableChoosingStickerRow);
cellGroup.rows.remove(ignoreBlockedRow);
cellGroup.rows.remove(dividerEnd);
NekoConfig.disableChatAction.setConfigBool(false);
NekoConfig.disableChoosingSticker.setConfigBool(false);
NekoConfig.ignoreBlocked.setConfigBool(false);
}
if (!NekoConfig.showRepeat.Bool() || NaConfig.INSTANCE.getShowRepeatAsCopy().Bool()){
cellGroup.rows.remove(autoReplaceRepeatRow);
NaConfig.INSTANCE.getAutoReplaceRepeat().setConfigBool(false);
}

listAdapter = new ListAdapter(context);

fragmentView = new FrameLayout(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ public class NekoGeneralSettingsActivity extends BaseNekoXSettingsActivity {
private UndoView restartTooltip;

public NekoGeneralSettingsActivity() {
if (!NekoXConfig.isDeveloper()) {
cellGroup.rows.remove(hideSponsoredMessageRow);
}
if (!BuildVars.isGServicesCompiled) {
cellGroup.rows.remove(mapDriftingFixForGoogleMapsRow);
}

addRowsToMap(cellGroup);
}

Expand Down Expand Up @@ -854,13 +861,13 @@ public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType
}

private void setCanNotChange() {
if (!NekoXConfig.isDeveloper())
cellGroup.rows.remove(hideSponsoredMessageRow);
// if (!NekoXConfig.isDeveloper())
// cellGroup.rows.remove(hideSponsoredMessageRow);

if (!BuildVars.isGServicesCompiled) {
NekoConfig.useOSMDroidMap.setConfigBool(true);
((ConfigCellTextCheck) useOSMDroidMapRow).setEnabled(false);
cellGroup.rows.remove(mapDriftingFixForGoogleMapsRow);
// cellGroup.rows.remove(mapDriftingFixForGoogleMapsRow);
} else {
if (NekoConfig.useOSMDroidMap.Bool())
((ConfigCellTextCheck) mapDriftingFixForGoogleMapsRow).setEnabled(false);
Expand Down

0 comments on commit 2118261

Please sign in to comment.