mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-11 04:25:53 +00:00
Remove PreferenceScreen dividers on API level > 21
This commit is contained in:
parent
b456249f62
commit
ec037b02e4
1 changed files with 10 additions and 0 deletions
|
@ -20,7 +20,9 @@ import android.support.annotation.Nullable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.ListAdapter;
|
import android.widget.ListAdapter;
|
||||||
|
import android.widget.ListView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.google.common.base.Splitter;
|
import com.google.common.base.Splitter;
|
||||||
|
@ -277,6 +279,14 @@ public class SettingsActivity extends SyncthingActivity {
|
||||||
Log.d(TAG, "Failed to get app version name");
|
Log.d(TAG, "Failed to get app version name");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove dividers
|
||||||
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
// For SDK version 21 and below, the code has to be within on CreateView.
|
||||||
|
View rootView = getView();
|
||||||
|
ListView list = (ListView) rootView.findViewById(android.R.id.list);
|
||||||
|
list.setDivider(null);
|
||||||
|
}
|
||||||
|
|
||||||
openSubPrefScreen(screen);
|
openSubPrefScreen(screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue