Skip to content

Instantly share code, notes, and snippets.

///////// ........ mRecyclerView ........... ///////////////////
mRecyclerView.addOnItemTouchListener(new RecyclerTouchListener( mRecyclerView, new RecyclerClickListener() {
@Override
public void onClick(View v, int position) {
Toast.makeText(getActivity(), "onClick " + position, Toast.LENGTH_SHORT).show();
}
@Override
public void onLongClick(View v, int position) {
Куча ошибок типа
In file included from *****************/libblkid/src/superblocks/squashfs.c:16:0:
*****************/include/bitops.h:46:29: error: expected ')' before '&' token
# define bswap_64(x) ((((x) & 0x00000000000000FFULL) << 56) | \
^
*****************/include/bitops.h:66:22: note: in expansion of macro 'bswap_64'
# define htobe64(x) bswap_64 (x)
^
F:/Run/Lprogr/Android/ndk/platforms/android-9/arch-arm/usr/include/sys/endian.h:164:12: note: in expansion of macro 'htobe64'
__uint64_t htobe64(__uint64_t);
/* $OpenBSD: endian.h,v 1.17 2006/01/06 18:53:05 millert Exp $ */
/*-
* Copyright (c) 1997 Niklas Hallqvist. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
/*
* getgrnam_r() implementation for Android NDK
*
* Copyright (c) 2015 may safely be consumed by a BSD or GPL license.
* Written by: Vladimir Oleynik <dzo@simtreas.ru>
*
*/
#include <sys/types.h>
#include <grp.h>
cmake_minimum_required(VERSION 3.1)
project(Test1)
set(RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/build/")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -include config.h")
set(BUILD_SHARED_LIBS OFF)
set(libcommon_SOURCE_FILES
# lib/loopdev.c
# lib/linux_version.c
package org.kinocat.testlib;
import android.annotation.SuppressLint;
import android.content.res.Resources;
import android.os.Build;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
@ilwsm
ilwsm / CheckableLayout.java
Created September 3, 2016 16:51 — forked from daichan4649/CheckableLayout.java
Checkable ListView (for Android)
package daichan4649.test;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Checkable;
import android.widget.LinearLayout;
public class CheckableLayout extends LinearLayout implements Checkable {
@ilwsm
ilwsm / CursorRecyclerViewAdapter.java
Created September 15, 2016 10:48 — forked from skyfishjy/CursorRecyclerViewAdapter.java
CursorRecyclerViewAdapter
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* 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
import android.app.Activity;
import android.app.Dialog;
import android.support.v4.app.DialogFragment;
/**
* Base dialog fragment.
* @param <Listener> listener type.
*/
public abstract class BaseDialogFragment<Listener> extends DialogFragment {
// in adb shell I sent this commands for simulating dialog's appears: (Airplane dialog (https://i.stack.imgur.com/Qatww.jpg) is showing on LG G2 phone, on other phones, this dialog may not appear. )
//"settings put global airplane_mode_on 1;am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true"
//"settings put global airplane_mode_on 0;am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false"
//or start another my dialog-style application, like:
// am start -n "org.kinocat.goodsearcher/org.kinocat.goodsearcher.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
//but always topActivity = my main activity .
package org.kinocat.myapplication;
import android.app.Activity;