Configure screen finalized. Added divider for LiveUpdates.

This commit is contained in:
GaidamakUA 2016-04-04 15:50:54 +03:00
parent 63ab190eb2
commit 72b5cf9fcf
5 changed files with 36 additions and 15 deletions

View file

@ -42,4 +42,10 @@
tools:visibility="visible"/>
</LinearLayout>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
</LinearLayout>

View file

@ -83,11 +83,12 @@
android:focusable="false"/>
<View
android:id="@+id/divider"
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:layout_alignLeft="@+id/text_wrapper"
android:layout_alignStart="@+id/text_wrapper"
android:background="?attr/divider_color"/>
android:background="?attr/dashboard_divider"/>
</RelativeLayout>

View file

@ -114,20 +114,20 @@ public class ContextMenuAdapter {
final Set<ApplicationMode> selected = new LinkedHashSet<>();
return AppModeDialog.prepareAppModeDrawerView((Activity) getContext(),
selected, true, new View.OnClickListener() {
@Override
public void onClick(View view) {
if (selected.size() > 0) {
app.getSettings().APPLICATION_MODE.set(selected.iterator().next());
notifyDataSetChanged();
}
if (changeAppModeListener != null) {
changeAppModeListener.onClick();
}
}
});
@Override
public void onClick(View view) {
if (selected.size() > 0) {
app.getSettings().APPLICATION_MODE.set(selected.iterator().next());
notifyDataSetChanged();
}
if (changeAppModeListener != null) {
changeAppModeListener.onClick();
}
}
});
}
if (convertView == null || !(convertView.getTag() instanceof Integer)
|| (layoutId != (Integer)convertView.getTag())) {
|| (layoutId != (Integer) convertView.getTag())) {
convertView = LayoutInflater.from(getContext()).inflate(layoutId, parent, false);
convertView.setTag(layoutId);
}
@ -257,6 +257,15 @@ public class ContextMenuAdapter {
descriptionTextView.setVisibility(View.GONE);
}
}
View dividerView = convertView.findViewById(R.id.divider);
if (dividerView != null) {
if (getCount() - 1 == position || getItem(position + 1).isCategory()) {
dividerView.setVisibility(View.GONE);
} else {
dividerView.setVisibility(View.VISIBLE);
}
}
return convertView;
}

View file

@ -95,8 +95,6 @@ import java.util.Map;
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
/**
*/
public class DashboardOnMap implements ObservableScrollViewCallbacks, DynamicListViewCallbacks,
IRouteInformationListener, WaypointDialogHelperCallbacks, MapMarkersDialogHelperCallbacks,
MapMarkerChangedListener {

View file

@ -387,6 +387,13 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment implements InAppList
topShadowView.setVisibility(View.VISIBLE);
liveUpdatesSwitch.setVisibility(View.GONE);
}
View divider = view.findViewById(R.id.divider);
if (getChildrenCount(groupPosition) == 0) {
divider.setVisibility(View.GONE);
} else {
divider.setVisibility(View.VISIBLE);
}
return view;
}