我当前的 CultureInfo ci=new CultureInfo("en-US");
ci.DateTimeFormat.ShortTimePattern = "";
ci.DateTimeFormat.LongTimePattern = "";
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
Console.WriteLine(DateTime.Now.ToString());
如下所示:
public class MySwipeRefreshLayout extends SwipeRefreshLayout {
private int mTouchSlop;
private float mPrevX;
// Indicate if we've already declined the move event
private boolean mDeclined;
public MySwipeRefreshLayout(Context context, AttributeSet attrs) {
super(context, attrs);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
}
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mPrevX = MotionEvent.obtain(event).getX();
mDeclined = false; // New action
break;
case MotionEvent.ACTION_MOVE:
final float eventX = event.getX();
float xDiff = Math.abs(eventX - mPrevX);
if (mDeclined || xDiff > mTouchSlop) {
mDeclined = true; // Memorize
return false;
}
}
return super.onInterceptTouchEvent(event);
}
}
我觉得很奇怪,一方面Makefile
被定义,而SRC_FILES := $(wildcard $(SRCDIR)/*.cpp)
OBJ_FILES := $(patsubst $(SRCDIR)/%, $(BUILDDIR)/%, $(SRC_FILES:.cpp=.o))
$(TARGET): $(OBJ_FILES)
$(CC) $(CFLAGS) $^ -o $@
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp # <----------- HERE
mkdir -p $(BUILDDIR)
$(CC) $(CFLAGS) -c -o $@ $<
确实依赖它,另一方面OBJ_FILES
没有& #34;规则&#34 ;.实际上,目标文件是根据通配符匹配规则编译的,在上面的代码中由$(TARGET)
标记。
有没有更好的方法来达到同样的效果?