Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74f97c62 authored by Steve McKay's avatar Steve McKay
Browse files

Don't show divider before debug section.

Remove unnecessary methods from TableDisplay interface.

Test: Visual + running small and medium tests.
Change-Id: I22b883146dec811b6d94c1fc3c578620418bfe48
parent a48df2f6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="20dp"
            android:visibility="gone" />

    </LinearLayout>
+2 −2
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ public class DebugView extends TableView implements DebugDisplay {

    @Override
    public void accept(DocumentInfo info) {
        setTitle(R.string.inspector_debug_section);
        setTitle(R.string.inspector_debug_section, false);

        put(R.string.debug_content_uri, info.derivedUri.toString());
        put(R.string.debug_document_id, info.documentId);
@@ -128,7 +128,7 @@ public class DebugView extends TableView implements DebugDisplay {
    private void dumpMetadata(String type, Bundle bundle) {
        String title = mContext.getResources().getString(
                R.string.inspector_debug_metadata_section);
        putTitle(String.format(title, type));
        putTitle(String.format(title, type), true);
        List<String> keys = new ArrayList<>(bundle.keySet());
        Collections.sort(keys);
        for (String key : keys) {
+0 −5
Original line number Diff line number Diff line
@@ -400,11 +400,6 @@ public final class InspectorController {
     */
    public interface TableDisplay extends Display {

        /**
         * Sets the title of the data.
         */
        void setTitle(@StringRes int title);

        /**
         * Adds a row in the table.
         */
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public class MediaView extends TableView implements MediaDisplay {

    @Override
    public void accept(DocumentInfo doc, Bundle metadata, @Nullable Runnable geoClickListener) {
        setTitle(R.string.inspector_metadata_section);
        setTitle(R.string.inspector_metadata_section, true);

        Bundle exif = metadata.getBundle(DocumentsContract.METADATA_EXIF);
        if (exif != null) {
+6 −4
Original line number Diff line number Diff line
@@ -56,17 +56,19 @@ public class TableView extends LinearLayout implements TableDisplay {
        mRes = context.getResources();
    }

    @Override
    public void setTitle(@StringRes int title) {
        putTitle(mContext.getResources().getString(title));
    void setTitle(@StringRes int title, boolean showDivider) {
        putTitle(mContext.getResources().getString(title), showDivider);
    }

    // A naughty title method (that takes strings, not message ids), mostly for DebugView.
    protected void putTitle(CharSequence title) {
    protected void putTitle(CharSequence title, boolean showDivider) {
        TextView view = mTitles.get(title);
        if (view == null) {
            LinearLayout layout =
                (LinearLayout) mInflater.inflate(R.layout.inspector_section_title, null);
            if (!showDivider) {
                layout.setDividerDrawable(null);
            }
            view = (TextView) layout.findViewById(R.id.inspector_header_title);
            addView(layout);
            mTitles.put(title, view);
Loading