This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// One of the simplest ways to display an animated gif is to use a third-party library. | |
// https://github.com/Hipmob/gifanimateddrawable | |
// MainActivity.java | |
public class MainActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
// Find the ImageView to display the GIF | |
ImageView ivGif = (ImageView) findViewById(R.id.ivGif); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
session = new SessionRSModel(); | |
session.chatId = msgByS.chatId; | |
session.meId = msg.meId; | |
session.sessionId = FunctionUtil.createSessionId( | |
msgByS.chatType, msg.meId, msgByS.chatId, | |
msg.sender); | |
session.sessionId = FunctionUtil.MD5(System.currentTimeMillis()+""); | |
session.type = msgByS.chatType; | |
session.stick = UtilsConstants.SESSION_N_STICK; | |
if ("u:1234567890".equals(msg.sender)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (userList != null && userList.size() > 0) { | |
ConnectedSqliteHelper.instance(mContext).insertSnsUserInfos(userList); | |
ArrayList<PathAssignedModel> pathAssignedModels = new ArrayList<PathAssignedModel>(); | |
PathAssignedModel model = null; | |
for (int q = 0; q < userList.size(); q++) { | |
model = new PathAssignedModel(); | |
model.addUid(userList.get(q).userId); | |
pathAssignedModels.add(model); | |
} | |
// if(!TextUtils.isEmpty(msgByS.chatId)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Bitmap combineImages(Bitmap bgd, Bitmap fg) { | |
Bitmap bmp; | |
int width = bgd.getWidth() > fg.getWidth() ? | |
bgd.getWidth() : fg.getWidth(); | |
int height = bgd.getHeight() > fg.getHeight() ? | |
bgd.getHeight() : fg.getHeight(); | |
bmp = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); | |
Paint paint = new Paint(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2013 Peng fei Pan <sky@xiaopan.me> | |
* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.xiaopan.android.util; | |
import java.io.ByteArrayInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2013 Peng fei Pan <sky@xiaopan.me> | |
* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.xiaopan.android.widget; | |
import java.lang.reflect.Field; | |
import android.content.Context; | |
import android.util.Log; | |
import android.view.Gravity; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.view.ViewGroup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Modify this with your IP range | |
MY_IP_RANGE="192\.168\.1" | |
#You usually wouldn't have to modify this | |
PORT_BASE=5555 | |
#List the devices on the screen for your viewing pleasure | |
adb devices |
OlderNewer