DrawerMenu W / PathParser: Points are too far 4.000000596046461 on Android

1

I created a new project using the wizard to implement side menu DrawerLayout

when selecting from the menu an item onNavigationItemSelected the debug returns me

  

W / PathParser: Points are too far 4.000000596046461 apart

What can it be due to?

public class MainActivity extends AppCompatActivity
        implements NavigationView.OnNavigationItemSelectedListener {

    private String TAG = MainActivity.class.getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        drawer.addDrawerListener(toggle);
        toggle.syncState();

        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);
    }

    @Override
    public void onBackPressed() {
        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        if (drawer.isDrawerOpen(GravityCompat.START)) {
            drawer.closeDrawer(GravityCompat.START);
        } else {
            super.onBackPressed();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        int id = item.getItemId();

        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @SuppressWarnings("StatementWithEmptyBody")
    @Override
    public boolean onNavigationItemSelected(@NonNull MenuItem item) {

        Log.i(TAG, "onNavigationItemSelected: ");
        // Handle navigation view item clicks here.
        int id = item.getItemId();

        if (id == R.id.nav_camera) {

        } else if (id == R.id.nav_gallery) {

        } else if (id == R.id.nav_slideshow) {

        } else if (id == R.id.nav_manage) {

        } else if (id == R.id.nav_share) {

        } else if (id == R.id.nav_send) {

        }

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        drawer.closeDrawer(GravityCompat.START);
        return true;
    }
}

content_main.xlm

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.webserveis.app.testdrawable.MainActivity"
    tools:showIn="@layout/app_bar_main">

    <FrameLayout
        android:id="@+id/frame_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>

Gradle

buildToolsVersion "25.0.2"
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
    
asked by Webserveis 09.05.2017 в 15:44
source

2 answers

1

As far as I understand, the problem is in one of the vector icons (image in XML format), during the rendering process to paint the image and / or build the animation.
It would be necessary to identify the image that is generating the warning, and analyze its pathData statements.
If I interpret the error message correctly, it should be located when the link (origin point-> destination point) is greater than 4 (it is when it shows the warning), and define an intermediate point.

    
answered by 21.12.2017 в 11:24
0

The solution is not 100% but I can assure you that it is in the theme of the icons that the Android Studio base template uses, it has been changing them and the error has disappeared.

drawables.xml

<resources xmlns:android="http://schemas.android.com/apk/res/android">
    <item name="ic_menu_home" type="drawable">@drawable/ic_home</item>
    <item name="ic_menu_list" type="drawable">@drawable/ic_view_list_black_24dp</item>
    <item name="ic_menu_map" type="drawable">@drawable/ic_map_black_24dp</item>
    <item name="ic_menu_settings" type="drawable">@drawable/ic_settings_black_24dp</item>
    <item name="ic_menu_about" type="drawable">@drawable/ic_info_black_24dp</item>
</resources>

activity_main_drawer.xml

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <group android:checkableBehavior="single">
        <item
            android:id="@+id/nav_home"
            android:icon="@drawable/ic_menu_home"
            android:title="Import" />
        <item
            android:id="@+id/nav_list"
            android:icon="@drawable/ic_menu_list"
            android:title="Gallery" />
        <item
            android:id="@+id/nav_map"
            android:icon="@drawable/ic_menu_map"
            android:title="Slideshow" />
    </group>

    <item android:title="Communicate">
        <menu>
            <item
                android:id="@+id/nav_settings"
                android:icon="@drawable/ic_menu_settings"
                android:title="Share" />
            <item
                android:id="@+id/nav_about"
                android:icon="@drawable/ic_menu_about"
                android:title="Send" />
        </menu>
    </item>

</menu>
    
answered by 09.05.2017 в 16:41