Я начал получать ошибку:
android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class me.markosullivan.swiperevealactionbuttons.SwipeRevealLayout
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class me.markosullivan.swiperevealactionbuttons.SwipeRevealLayout
Caused by: java.lang.ClassNotFoundException: Didn't find class "me.markosullivan.swiperevealactionbuttons.SwipeRevealLayout" on path: DexPathList[[zip file "/data/app/de.jobnetzwerk.jobnet-1/base.apk", zip file "/data/app/de.jobnetzwerk
Я пытаюсь сделать что-то вроде этого решение. Вот мой макет:
<?xml version = "1.0" encoding = "utf-8"?>
<me.markosullivan.swiperevealactionbuttons.SwipeRevealLayout xmlns:android = "http://schemas.android.com/apk/res/android"
xmlns:app = "http://schemas.android.com/apk/res-auto"
android:layout_width = "match_parent"
android:layout_height = "90dp"
app:dragFromEdge = "right">
<FrameLayout
android:layout_width = "wrap_content"
android:layout_height = "match_parent">
<LinearLayout
android:layout_width = "wrap_content"
android:layout_height = "match_parent"
android:gravity = "center_vertical|end"
android:orientation = "horizontal"
android:paddingStart = "20dp"
android:paddingEnd = "20dp">
<ImageButton
android:id = "@+id/archive"
android:layout_width = "50dp"
android:layout_height = "50dp"
android:text = "Info"
app:srcCompat = "@drawable/ic_inbox" />
<ImageButton
android:id = "@+id/delete"
android:layout_width = "50dp"
android:layout_height = "50dp"
android:text = "Edit"
app:srcCompat = "@drawable/ic_delete" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:layout_marginStart = "15dp"
android:layout_marginTop = "4dp"
android:layout_marginEnd = "15dp"
android:background = "@drawable/message_list_item_bg"
android:clickable = "true"
android:focusable = "true">
<RelativeLayout
android:layout_width = "match_parent"
android:layout_height = "wrap_content"
android:layout_margin = "5dp"
android:visibility = "visible">
<LinearLayout
android:id = "@+id/layout"
android:layout_width = "match_parent"
android:layout_height = "wrap_content"
android:orientation = "horizontal">
<TextView
android:id = "@+id/title_of_item"
android:layout_width = "0dp"
android:layout_height = "wrap_content"
android:layout_marginStart = "5dp"
android:layout_weight = "15"
android:ellipsize = "end"
android:singleLine = "true"
android:textColor = "@color/black"
android:textSize = "14sp" />
<TextView
android:id = "@+id/date_of_item"
android:layout_width = "0dp"
android:layout_height = "wrap_content"
android:layout_marginStart = "5dp"
android:layout_marginEnd = "5dp"
android:layout_weight = "5"
android:gravity = "end"
android:textColor = "@color/black"
android:textSize = "14sp" />
</LinearLayout>
<TextView
android:id = "@+id/job_location"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:layout_below = "@id/layout"
android:layout_marginStart = "5dp"
android:layout_marginTop = "5dp"
android:layout_marginEnd = "60dp"
android:ellipsize = "end"
android:singleLine = "true"
android:textColor = "@color/black" />
<TextView
android:id = "@+id/jobStatus"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:layout_below = "@id/layout"
android:layout_alignParentEnd = "true"
android:layout_marginTop = "5dp"
android:layout_marginEnd = "5dp"
android:textStyle = "bold" />
<com.lsjwzh.widget.materialloadingprogressbar.CircleProgressBar
android:id = "@+id/loader"
android:layout_width = "36dp"
android:layout_height = "36dp"
android:layout_centerInParent = "true"
android:visibility = "gone"
app:mlpb_arrow_height = "2dp"
app:mlpb_arrow_width = "7dp"
app:mlpb_enable_circle_background = "true"
app:mlpb_progress_stoke_width = "2.5dp"
app:mlpb_show_arrow = "false" />
<TextView
android:id = "@+id/company_name"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:layout_below = "@id/job_location"
android:layout_marginStart = "5dp"
android:layout_marginTop = "5dp"
android:ellipsize = "end" />
</RelativeLayout>
</FrameLayout>
</me.markosullivan.swiperevealactionbuttons.SwipeRevealLayout>
Я также сделал класс, который предоставит мне группу просмотра, но я получаю эту ошибку, когда пытаюсь запустить свое приложение. Почему это происходит и как я могу решить эту ошибку? Пробовал аннулировать кеш и перезапускать AS, но мне это не помогло.
Вам нужно использовать собственное имя пакета при использовании SwipeRevealLayout
, так как вы реализуете пример проекта, который объявляет класс SwipeRevealLayout
с собственным пакетом me.markosullivan.swiperevealactionbuttons
, поэтому, если вы объявили свою собственную реализацию SwipeRevealLayout.java
в пакете de.jobnetzwerk.jobnet
, ваше использование xml будет:
<?xml version = "1.0" encoding = "utf-8"?>
<de.jobnetzwerk.jobnet.SwipeRevealLayout
...