根据截图我想实现以下ScreenUI(Android API> = 10):
您有GoogleMapsSupportFragement
和ListView
,它们共享视图的剩余高度(height
是在应用程序启动时计算的,而应用程序仅在{{1}中运行})
PortraitMode
容器的行为应该类似于Android-Notification菜单,因此用户可以滑入和滑出List,但是如果用户释放视图(触摸屏),动画就会启动。
到目前为止,我实施了两个ListView
(LinearLayout
和Map
),它们除以红线(ListView
)。我管理过,ListView在红线上单击显示/隐藏,但是如果我隐藏了ListView,它看起来很奇怪,因为地图被重绘并留下了黑色空间..
问题是:什么LinearLayout
onTouchBehaviour`(类似于打开通知菜单)?
这是我的实施:
s best way to implement (LinearLayout? Fragments?)? Do you know examples for the
Layout.xml
//function is triggered at click on the redline-button
private void toggleOverlayList(){
//TEST CASE API >= 11
int mListHeight = ((LinearLayout) findViewById(R.id.map_list)).getLayoutParams().height;
Log.i(DEBUG,"toggleOverlayList() -> currentHeight:" + mListHeight );
if(mListHeight == 0){
((LinearLayout) findViewById(R.id.map_wrapper)).getLayoutParams().height = mDisplayHeight;
((LinearLayout) findViewById(R.id.map_list)).getLayoutParams().height = mDisplayHeight;
((LinearLayout) findViewById(R.id.main_screen)).requestLayout();
}
else{
((LinearLayout) findViewById(R.id.map_wrapper)).getLayoutParams().height = 2* mDisplayHeight;
((LinearLayout) findViewById(R.id.map_list)).getLayoutParams().height = 0;
((LinearLayout) findViewById(R.id.main_screen)).requestLayout();
}
}