Skip to content

Instantly share code, notes, and snippets.

package com.dengionline.content.faq;
import android.content.Context;
import com.dengionline.R;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
SELECT friends._id, friends.global_first_name, friends.global_last_name, friends.friend_first_name, friends.friend_last_name, friends.status_text, friends.avatar_url
LEFT OUTER JOIN buddies ON buddies._id =
(SELECT buddies_contacts.buddy_id FROM buddies_contacts WHERE buddies_contacts.contact_hash IN
(SELECT friends_contacts.contact_hash FROM friends_contacts WHERE friends_contacts.private_user_id = friends.private_user_id))
FROM friends_contacts
WHERE type = ?
ORDER BY global_first_name COLLATE LOCALIZED ASC
public class DefaultLog implements Log {
public static final String DEFAULT_TAG = "Ln";
private String mDefaultTag;
public DefaultLog(String defaultTag) {
mDefaultTag = defaultTag;
}
String sql =
"SELECT " +
"chats._id, chats.title, " +
"display_names_view.first_name, display_names_view.last_name, friends.avatar_thumb, " +
"chats.last_create_operation_time, " +
"(SELECT chat_messages.message FROM chat_messages WHERE chat_messages.chat_local_id = chats._id ORDER BY chat_messages._id DESC LIMIT 1) AS last_message, " +
"(SELECT COUNT(1) " +
"FROM chat_messages " +
"WHERE chat_messages.chat_local_id = chats._id AND chat_messages.creator_id <> ? AND chat_messages.status = ?" +
") AS count_unread," +
public class AppInstance extends Application {
private static AppInstance mInstance;
@Inject
IStorage mStorage;
@Override
public void onCreate() {
super.onCreate();
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Property {
String[] property() default {};
}
public class PropertyChangeListenerAnnotated implements PropertyChangeListener {
private Handler mDefaultHandler;
private ViewTreeObserver.OnGlobalLayoutListener mOnGlobalLayoutListener;
class OnGlobalLayoutListenerImpl implements ViewTreeObserver.OnGlobalLayoutListener {
@Override
public void onGlobalLayout() {
int heightDiff = mViewHolder.activityRootView.getRootView().getHeight() - mViewHolder.activityRootView.getHeight();
if ((heightDiff > getMinKeyboardHeight()) != mIsKeyboardDisplayed) {
mIsKeyboardDisplayed = heightDiff > getMinKeyboardHeight();
setElementVisibilityForSearch(mIsKeyboardDisplayed);
}
public class MainFragment extends Fragment {
private Model mModel;
private TextView mTextView;
@Override
@SuppressWarnings("ConstantConditions")
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSubscriptionChatNotSynced = Observable
.combineLatest(
mMessagesListModel.isVisibleObservable(),
mMessagesListModel.isChatSyncedObervable(),
new Func2<Boolean, Boolean, Boolean>() {
@Override
public boolean hasNetwork() {
ConnectivityManager connectivityManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivityManager == null) {
return false;
}
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo == null) {
return false;
}