mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-06-19 21:05:25 +08:00
Make fab down clickable on Android TV
This commit is contained in:
parent
049af45f42
commit
2b52fcaa50
@ -41,13 +41,13 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.DocumentsContract;
|
||||
import android.provider.MediaStore;
|
||||
import android.provider.OpenableColumns;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
@ -294,6 +294,22 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if(keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) {
|
||||
// Clicking "right" from the connections view goes to the fab down item
|
||||
if(mPager.getCurrentItem() == POS_CONNECTIONS) {
|
||||
RecyclerView rview = findViewById(R.id.connections_view);
|
||||
|
||||
if(rview.getFocusedChild() != null) {
|
||||
Log.d(TAG, "onKeyDown (right) focus " + rview.getFocusedChild());
|
||||
|
||||
View fab = findViewById(R.id.fabDown);
|
||||
|
||||
if(fab != null) {
|
||||
fab.requestFocus();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.onKeyDown(keyCode, event);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user