0
点赞
收藏
分享

微信扫一扫

Android 5,kotlin接口回调

巧乐兹_d41f 2022-02-18 阅读 74
  • and/or permission notice(s).

*/

/*

  • Copyright © 2010 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

  • distributed under the License is distributed on an “AS IS” BASIS,

  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

  • See the License for the specific language governing permissions and

  • limitations under the License.

*/

package com.android.gallery3d.data;

import android.net.Uri;

public abstract class MediaObject {

@SuppressWarnings(“unused”)

private static final String TAG = “Gallery2/MediaObject”;

public static final long INVALID_DATA_VERSION = -1;

// These are the bits returned from getSupportedOperations():

public static final int SUPPORT_DELETE = 1 << 0;

public static final int SUPPORT_ROTATE = 0 << 1;

public static final int SUPPORT_SHARE = 0 << 2;

public static final int SUPPORT_CROP = 0 << 3;

public static final int SUPPORT_SHOW_ON_MAP = 0 << 4;

public static final int SUPPORT_SETAS = 0 << 5;

public static final int SUPPORT_FULL_IMAGE = 1 << 6;

public static final int SUPPORT_PLAY = 1 << 7;

public static final int SUPPORT_CACHE = 1 << 8;

public static final int SUPPORT_EDIT = 0 << 9;

public static final int SUPPORT_INFO = 1 << 10;

public static final int SUPPORT_TRIM = 0 << 11;

public static final int SUPPORT_UNLOCK = 1 << 12;

public static final int SUPPORT_BACK = 1 << 13;

public static final int SUPPORT_ACTION = 1 << 14;

public static final int SUPPORT_CAMERA_SHORTCUT = 1 << 15;

public static final int SUPPORT_MUTE = 1 << 16;

public static final int SUPPORT_PRINT = 0 << 17;

/// M: [FEATURE.ADD] @{

public static final int SUPPORT_DC = 1 << 27;

public static final int SUPPORT_PROTECTION_INFO = 1 << 28;

public static final int SUPPORT_PQ = 1 << 29;

public static final int SUPPORT_EXPORT = 1 << 30;

/// @}

public static final int SUPPORT_ALL = 0xffffffff;

// These are the bits returned from getMediaType():

public static final int MEDIA_TYPE_UNKNOWN = 1;

public static final int MEDIA_TYPE_IMAGE = 2;

public static final int MEDIA_TYPE_VIDEO = 4;

public static final int MEDIA_TYPE_ALL = MEDIA_TYPE_IMAGE | MEDIA_TYPE_VIDEO;

public static final String MEDIA_TYPE_IMAGE_STRING = “image”;

public static final String MEDIA_TYPE_VIDEO_STRING = “video”;

public static final String MEDIA_TYPE_ALL_STRING = “all”;

// These are flags for cache() and return values for getCacheFlag():

public static final int CACHE_FLAG_NO = 0;

public static final int CACHE_FLAG_SCREENNAIL = 1;

public static final int CACHE_FLAG_FULL = 2;

// These are return values for getCacheStatus():

public static final int CACHE_STATUS_NOT_CACHED = 0;

public static final int CACHE_STATUS_CACHING = 1;

public static final int CACHE_STATUS_CACHED_SCREENNAIL = 2;

public static final int CACHE_STATUS_CACHED_FULL = 3;

private static long sVersionSerial = 0;

protected long mDataVersion;

protected final Path mPath;

public interface PanoramaSupportCallback {

void panoramaInfoAvailable(MediaObject mediaObject, boolean isPanorama,

boolean isPanorama360);

}

public MediaObject(Path path, long version) {

path.setObject(this);

mPath = path;

mDataVersion = version;

}

public Path getPath() {

return mPath;

}

public int getSupportedOperations() {

return 0;

}

public void getPanoramaSupport(PanoramaSupportCallback callback) {

callback.panoramaInfoAvailable(this, false, false);

}

public void clearCachedPanoramaSupport() {

}

public void delete() {

throw new UnsupportedOperationException();

}

public void rotate(int degrees) {

throw new UnsupportedOperationException();

}

尾声

评论里面有些同学有疑问关于如何学习material design控件,我的建议是去GitHub搜,有很多同行给的例子,这些栗子足够入门。

有朋友说要是动真格的话,需要NDK以及JVM等的知识,首现**NDK并不是神秘的东西,**你跟着官方的步骤走一遍就知道什么回事了,无非就是一些代码格式以及原生/JAVA内存交互,进阶一点的有原生/JAVA线程交互,线程交互确实有点蛋疼,但平常避免用就好了,再说对于初学者来说关心NDK干嘛,据鄙人以前的经历,只在音视频通信和一个嵌入式信号处理(离线)的两个项目中用过,嵌入式信号处理是JAVA->NDK->.SO->MATLAB这样调用的我原来MATLAB的代码,其他的大多就用在游戏上了吧,一般的互联网公司会有人给你公司的SO包的。
至于JVM,该掌握的那部分,相信我,你会掌握的,不该你掌握的,有那些专门研究JVM的人来做,不如省省心有空看看计算机系统,编译原理。

一句话,平常多写多练,这是最基本的程序员的素质,尽量挤时间,读理论基础书籍,JVM不是未来30年唯一的虚拟机,JAVA也不一定再风靡未来30年工业界,其他的系统和语言也会雨后春笋冒出来,但你理论扎实会让你很快理解学会一个语言或者框架,你平常写的多会让你很快熟练的将新学的东西应用到实际中。
初学者,一句话,多练。

举报

相关推荐

0 条评论