Skip to content

Commit

Permalink
update HAL service decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Dec 18, 2021
1 parent fb967a8 commit 2600c31
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package cc.ioctl.nfcdevicehost.activity.ui.dump;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;

import java.util.Date;
import java.util.Locale;

import cc.ioctl.nfcdevicehost.R;
import cc.ioctl.nfcdevicehost.decoder.NciPacketDecoder;
import cc.ioctl.nfcdevicehost.decoder.NxpHalV2EventTranslator;
import cc.ioctl.nfcdevicehost.util.ByteUtils;
Expand Down Expand Up @@ -117,4 +122,14 @@ public NciDumpViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewT
}
}

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
}

@Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
requireActivity().getMenuInflater().inflate(R.menu.menu_main_fragment_dump_common, menu);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class NciLiveDumpFragment extends BaseHalDumpFragment implements Observer

private FragmentMainDumpBinding mBinding;
private NciDumpViewModel mNciDumpViewModel;
private boolean mShowDecodedPacket = true;
private final AbsNciDumpAdapter mDumpAdapter = new AbsNciDumpAdapter() {
@Override
public void onBindViewHolder(@NonNull NciDumpViewHolder holder, int position) {
Expand Down Expand Up @@ -129,7 +130,8 @@ public void jumpToHomeFragment() {

@Override
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
requireActivity().getMenuInflater().inflate(R.menu.menu_main_fragment_dump, menu);
super.onCreateOptionsMenu(menu, inflater);
requireActivity().getMenuInflater().inflate(R.menu.menu_main_fragment_dump_live, menu);
}

@Override
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions app/src/main/res/menu/menu_main_fragment_dump_common.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_decoder_config"
android:icon="@drawable/ic_project_properties"
android:menuCategory="alternative"
android:orderInCategory="99"
android:title="@string/action_decoder_config"
app:showAsAction="ifRoom" />
</menu>
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ NCI Host 的开发人员不对使用此应用程序造成的任何损失负责
<string name="action_submit">提交</string>
<string name="ui_toast_operation_success_v0s">操作成功: %s</string>
<string name="ui_dialog_error_message_invalid_input_syntax_v0s">输入的数据格式有误: %s</string>
<string name="action_decoder_config">解码器配置</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,5 @@ By using this application, you accept all responsibility using it and agree that
<string name="action_submit">Submit</string>
<string name="ui_toast_operation_success_v0s">Operation success: %s</string>
<string name="ui_dialog_error_message_invalid_input_syntax_v0s">Invalid input: %s</string>
<string name="action_decoder_config">Decoder properties</string>
</resources>

0 comments on commit 2600c31

Please sign in to comment.