Skip to content

Commit 899255f

Browse files
committed
move breadcrumbs to views folder
1 parent 6d23026 commit 899255f

File tree

7 files changed

+9
-176
lines changed

7 files changed

+9
-176
lines changed

app/src/main/java/com/simplemobiletools/filemanager/activities/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import com.simplemobiletools.filemanager.Utils;
1616
import com.simplemobiletools.filemanager.fragments.ItemsFragment;
1717
import com.simplemobiletools.filepicker.models.FileDirItem;
18-
import com.simplemobiletools.filepicker.Breadcrumbs;
18+
import com.simplemobiletools.filepicker.views.Breadcrumbs;
1919

2020
import butterknife.BindView;
2121
import butterknife.ButterKnife;

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
android:layout_width="match_parent"
66
android:layout_height="match_parent">
77

8-
<com.simplemobiletools.filepicker.Breadcrumbs
8+
<com.simplemobiletools.filepicker.views.Breadcrumbs
99
android:id="@+id/breadcrumbs"
1010
android:layout_width="match_parent"
1111
android:layout_height="wrap_content"

app/src/main/res/layout/directory_picker.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
android:layout_height="wrap_content"
77
android:orientation="vertical">
88

9-
<com.simplemobiletools.filepicker.Breadcrumbs
9+
<com.simplemobiletools.filepicker.views.Breadcrumbs
1010
android:id="@+id/directory_picker_breadcrumbs"
1111
android:layout_width="match_parent"
1212
android:layout_height="wrap_content"

library/src/main/kotlin/com/simplemobiletools/filepicker/Breadcrumbs.kt

Lines changed: 0 additions & 166 deletions
This file was deleted.

library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import android.os.Bundle
77
import android.support.v4.app.DialogFragment
88
import android.support.v7.app.AlertDialog
99
import android.view.View
10-
import com.simplemobiletools.filepicker.Breadcrumbs
1110
import com.simplemobiletools.filepicker.R
1211
import com.simplemobiletools.filepicker.adapters.ItemsAdapter
1312
import com.simplemobiletools.filepicker.extensions.getFilenameFromPath
1413
import com.simplemobiletools.filepicker.models.FileDirItem
14+
import com.simplemobiletools.filepicker.views.Breadcrumbs
1515
import kotlinx.android.synthetic.main.smtfp_directory_picker.view.*
1616
import java.io.File
1717
import java.util.*

library/src/main/kotlin/com/simplemobiletools/filepicker/views/Breadcrumbs.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class Breadcrumbs(context: Context, attrs: AttributeSet) : LinearLayout(context,
5353
for (i in 0..cnt - 1) {
5454
val child = getChildAt(i)
5555

56-
child.measure(View.MeasureSpec.makeMeasureSpec(usableWidth, View.MeasureSpec.AT_MOST),
57-
View.MeasureSpec.makeMeasureSpec(childHeight, View.MeasureSpec.AT_MOST))
56+
child.measure(MeasureSpec.makeMeasureSpec(usableWidth, MeasureSpec.AT_MOST),
57+
MeasureSpec.makeMeasureSpec(childHeight, MeasureSpec.AT_MOST))
5858
curWidth = child.measuredWidth
5959
curHeight = child.measuredHeight
6060

@@ -91,7 +91,7 @@ class Breadcrumbs(context: Context, attrs: AttributeSet) : LinearLayout(context,
9191
}
9292
}
9393

94-
val parentWidth = View.MeasureSpec.getSize(widthMeasureSpec)
94+
val parentWidth = MeasureSpec.getSize(widthMeasureSpec)
9595
val calculatedHeight = paddingTop + paddingBottom + rowHeight * lines
9696
setMeasuredDimension(parentWidth, calculatedHeight)
9797
}
@@ -131,10 +131,10 @@ class Breadcrumbs(context: Context, attrs: AttributeSet) : LinearLayout(context,
131131

132132
fun addBreadcrumb(item: FileDirItem, addPrefix: Boolean) {
133133
val view = mInflater!!.inflate(R.layout.smtfp_breadcrumb_item, null, false)
134-
135134
var textToAdd = item.name
136135
if (addPrefix)
137136
textToAdd = " -> " + textToAdd
137+
138138
view.breadcrumb_text.text = textToAdd
139139
addView(view)
140140
view.setOnClickListener(this)

library/src/main/res/layout/smtfp_directory_picker.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
android:layout_height="wrap_content"
77
android:orientation="vertical">
88

9-
<com.simplemobiletools.filepicker.Breadcrumbs
9+
<com.simplemobiletools.filepicker.views.Breadcrumbs
1010
android:id="@+id/directory_picker_breadcrumbs"
1111
android:layout_width="match_parent"
1212
android:layout_height="wrap_content"
1313
android:padding="@dimen/smtfp_activity_margin"/>
1414

1515
<ListView
16-
xmlns:android="http://schemas.android.com/apk/res/android"
1716
android:id="@+id/directory_picker_list"
1817
android:layout_width="match_parent"
1918
android:layout_height="wrap_content"/>

0 commit comments

Comments
 (0)