Simple Horizontal Divider Item Decoration for RecyclerView
mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
getApplicationContext()
));
NOTE: Add item decoration prior to setting the adapter
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> | |
<!-- Generated by RHY @will_awoke --> | |
<module name="Checker"> | |
<property name="charset" value="UTF-8"/> | |
<property name="severity" value="warning"/> |
package criminalintent.android.bignerdranch.com.criminalintent; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.support.v4.app.FragmentManager; | |
public abstract class SingleFragmentActivity extends FragmentActivity { | |
protected abstract Fragment createFragment(); | |
@Override |
private final RectF touchedLineBounds = new RectF(); | |
@Override | |
public boolean onTouchEvent(TextView widget, Spannable buffer, | |
MotionEvent event) { | |
int action = event.getAction(); | |
if (action == MotionEvent.ACTION_UP || | |
action == MotionEvent.ACTION_DOWN) { | |
int x = (int) event.getX(); |
//只显示包名的list | |
adb shell "pm list packages"|cut -f 2 -d ":" | |
//显示全称的list | |
adb shell pm list packages -f |
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
package com.yelp.android.ui.widgets; | |
import com.yelp.android.R; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; |
import android.database.Cursor; | |
import android.support.annotation.NonNull; | |
import com.raizlabs.android.dbflow.runtime.DBTransactionInfo; | |
import com.raizlabs.android.dbflow.runtime.TransactionManager; | |
import com.raizlabs.android.dbflow.runtime.transaction.BaseTransaction; | |
import com.raizlabs.android.dbflow.runtime.transaction.QueryTransaction; | |
import com.raizlabs.android.dbflow.runtime.transaction.TransactionListener; | |
import com.raizlabs.android.dbflow.sql.builder.ConditionQueryBuilder; | |
import com.raizlabs.android.dbflow.sql.language.Delete; |
System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
在windows下我们通过Java的runtime.exec("ls > d://file.txt") 可以在D盘下面生成file.txt的文件 但是在mac下却没有结果,通过调试得到的解决方案如下:
package com.star;
import java.io.BufferedReader;
import java.io.InputStreamReader;