Search in sources :

Example 6 with CurrentRecording

use of net.osmand.plus.audionotes.AudioVideoNotesPlugin.CurrentRecording in project Osmand by osmandapp.

the class AudioVideoNoteRecordingMenu method applyViewfinderVisibility.

protected void applyViewfinderVisibility() {
    MapActivity mapActivity = plugin.getMapActivity();
    CurrentRecording recording = plugin.getCurrentRecording();
    boolean show = showViewfinder && recording != null && recording.getType() != AVActionType.REC_AUDIO;
    if (isLandscapeLayout() && mapActivity != null) {
        int buttonsHeight = (int) view.getResources().getDimension(R.dimen.map_route_buttons_height);
        int tileBoxHeight = mapActivity.getMapView().getCurrentRotatedTileBox().getPixHeight();
        int h = show ? tileBoxHeight : buttonsHeight;
        view.setLayoutParams(new LinearLayout.LayoutParams(AndroidUtils.dpToPx(mapActivity, 320f), h));
        view.requestLayout();
    }
    viewfinder.setVisibility(show ? View.VISIBLE : View.GONE);
}
Also used : CurrentRecording(net.osmand.plus.audionotes.AudioVideoNotesPlugin.CurrentRecording) LinearLayout(android.widget.LinearLayout) MapActivity(net.osmand.plus.activities.MapActivity)

Aggregations

CurrentRecording (net.osmand.plus.audionotes.AudioVideoNotesPlugin.CurrentRecording)6 DisplayMetrics (android.util.DisplayMetrics)2 SurfaceView (android.view.SurfaceView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 LinearLayout (android.widget.LinearLayout)1 TextView (android.widget.TextView)1 IconsCache (net.osmand.plus.IconsCache)1 MapActivity (net.osmand.plus.activities.MapActivity)1