当前位置: 首页>>代码示例>>Java>>正文


Java ObjectiveCName类代码示例

本文整理汇总了Java中com.google.j2objc.annotations.ObjectiveCName的典型用法代码示例。如果您正苦于以下问题:Java ObjectiveCName类的具体用法?Java ObjectiveCName怎么用?Java ObjectiveCName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ObjectiveCName类属于com.google.j2objc.annotations包,在下文中一共展示了ObjectiveCName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: swap

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
@ObjectiveCName("swapWithWindow:")
public void swap(Window that) {
    int tmp = top;
    top = that.top;
    that.top = tmp;

    tmp = left;
    left = that.left;
    that.left = tmp;

    tmp = width;
    width = that.width;
    that.width = tmp;

    tmp = height;
    height = that.height;
    that.height = tmp;

    tmp = z_index;
    z_index = that.z_index;
    that.z_index = tmp;
}
 
开发者ID:Piasy,项目名称:JavaUniverse,代码行数:23,代码来源:Window.java

示例2: touch

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
@MainThread
@ObjectiveCName("touchWithIndex:")
public void touch(int index) {
    im.actor.runtime.Runtime.checkMainThread();

    if (index >= getSize() - loadGap) {
        if (window.isForwardCompleted()) {
            if (bindHook != null) {
                bindHook.onScrolledToEnd();
            }
        } else {
            loadMoreForward();
        }
    }

    if (index < loadGap) {
        loadMoreBackward();
    }

    if (bindHook != null) {
        bindHook.onItemTouched(getItem(index));
    }
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:24,代码来源:BindedDisplayList.java

示例3: formatDialogText

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
/**
 * Formatting Dialog List text. Deprecated: you need to manually format Content and append
 * performer if needed and highlight it
 *
 * @param dialog dialog to format
 * @return formatted content
 */
@Deprecated
@ObjectiveCName("formatDialogText:")
public String formatDialogText(Dialog dialog) {
    // Detecting if dialog is empty
    if (dialog.getSenderId() == 0) {
        return "";
    } else {
        String contentText = formatContentText(dialog.getSenderId(),
                dialog.getMessageType(), dialog.getText(), dialog.getRelatedUid());
        if (dialog.getPeer().getPeerType() == PeerType.GROUP) {
            if (!isLargeDialogMessage(dialog.getMessageType())) {
                return formatPerformerName(dialog.getSenderId()) + ": " + contentText;
            } else {
                return contentText;
            }
        } else {
            return contentText;
        }
    }
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:28,代码来源:I18nEngine.java

示例4: formatFileSize

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
@ObjectiveCName("formatFileSize:")
public String formatFileSize(int bytes) {
    if (bytes < 0) {
        bytes = 0;
    }

    // TODO: Better rounding
    if (bytes < 1024) {
        return get("language.file_size.bytes")
                .replace("{bytes}", "" + bytes);
    } else if (bytes < 1024 * 1024) {
        return get("language.file_size.kbytes")
                .replace("{kbytes}", "" + (bytes / 1024));
    } else if (bytes < 1024 * 1024 * 1024) {
        return get("language.file_size.mbytes")
                .replace("{mbytes}", "" + (bytes / (1024 * 1024)));
    } else {
        return get("language.file_size.gbytes")
                .replace("{gbytes}", "" + (bytes / (1024 * 1024 * 1024)));
    }
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:22,代码来源:IntlEngine.java

示例5: map

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
/**
 * Mapping result value of promise to another value
 *
 * @param res mapping function
 * @param <R> destination type
 * @return promise
 */
@ObjectiveCName("map:")
public <R> Promise<R> map(final Function<T, R> res) {
    final Promise<T> self = this;
    return new Promise<>((PromiseFunc<R>) resolver -> {
        self.then(t -> {
            R r;
            try {
                r = res.apply(t);
            } catch (Exception e) {
                e.printStackTrace();
                resolver.tryError(e);
                return;
            }
            resolver.tryResult(r);
        });
        self.failure(e -> resolver.error(e));
    });
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:26,代码来源:Promise.java

示例6: Window

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
@ObjectiveCName("initWithWidth:height:top:left:zIndex:uid:")
public Window(int width, int height, int top, int left, int z_index, String uid) {
    this.width = width;
    this.height = height;
    this.top = top;
    this.left = left;
    this.z_index = z_index;
    this.uid = uid;
}
 
开发者ID:Piasy,项目名称:JavaUniverse,代码行数:10,代码来源:Window.java

示例7: AppleListUpdate

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
@ObjectiveCName("initWithRemoved:withAdded:withMoved:withUpdated:withLoadMore:")
public AppleListUpdate(ArrayList<Integer> removed,
                       ArrayList<Integer> added,
                       ArrayList<Move> moved,
                       ArrayList<Integer> updated, boolean isLoadMore) {
    this.removed = removed;
    this.added = added;
    this.moved = moved;
    this.updated = updated;
    this.isLoadMore = isLoadMore;
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:12,代码来源:AppleListUpdate.java

示例8: areSameDays

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
@ObjectiveCName("areSameDaysWithA:withB:")
public boolean areSameDays(long a, long b) {
    Date date1 = new Date(a);
    int y1 = date1.getYear();
    int m1 = date1.getMonth();
    int d1 = date1.getDate();
    Date date2 = new Date(b);
    int y2 = date2.getYear();
    int m2 = date2.getMonth();
    int d2 = date2.getDate();

    return y1 == y2 && m1 == m2 && d1 == d2;
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:14,代码来源:IntlEngine.java

示例9: addListener

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
@ObjectiveCName("addListener:")
public void addListener(Listener listener) {
    //im.actor.runtime.Runtime.checkMainThread();
    if (!listeners.contains(listener)) {
        listeners.add(listener);
    }
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:8,代码来源:DisplayList.java

示例10: findAllLinks

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
/**
 * Finding all messages with links
 *
 * @param peer peer for search
 * @return found messages
 */
@ObjectiveCName("findAllLinksWithPeer:")
public Command<List<MessageSearchEntity>> findAllLinks(Peer peer) {
    return callback -> modules.getSearchModule().findAllLinks(peer)
            .then(v -> callback.onResult(v))
            .failure(e -> callback.onError(e));
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:13,代码来源:Messenger.java

示例11: addAndroidListener

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
@ObjectiveCName("addAndroidListener:")
public void addAndroidListener(AndroidChangeListener<T> listener) {
    if (operationMode != OperationMode.ANDROID && operationMode != OperationMode.GENERAL) {
        throw new RuntimeException("Unable to set Android Listener in iOS mode");
    }
    //im.actor.runtime.Runtime.checkMainThread();

    if (!androidListeners.contains(listener)) {
        androidListeners.add(listener);
    }
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:12,代码来源:DisplayList.java

示例12: setPlatformType

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
/**
 * Set App Type
 *
 * @param platformType App Type
 * @return this
 */
@NotNull
@ObjectiveCName("setPlatformType:")
public ConfigurationBuilder setPlatformType(@NotNull PlatformType platformType) {
    this.platformType = platformType;
    return this;
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:13,代码来源:ConfigurationBuilder.java

示例13: subscribe

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
/**
 * Subscribe for GroupVM updates
 *
 * @param listener Listener for updates
 */
@MainThread
@ObjectiveCName("subscribeWithListener:withNotify:")
public void subscribe(@NotNull ModelChangedListener<GroupVM> listener, boolean notify) {
    im.actor.runtime.Runtime.checkMainThread();
    if (listeners.contains(listener)) {
        return;
    }
    listeners.add(listener);
    if (notify) {
        listener.onChanged(this);
    }
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:18,代码来源:GroupVM.java

示例14: subscribe

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
/**
 * Subscribe to UserVM updates
 *
 * @param listener UserVM changed listener
 */
@MainThread
@ObjectiveCName("subscribeWithListener:")
public void subscribe(@NotNull ModelChangedListener<UserVM> listener) {
    Runtime.checkMainThread();
    if (listeners.contains(listener)) {
        return;
    }
    listeners.add(listener);
    listener.onChanged(this);
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:16,代码来源:UserVM.java

示例15: findAllPhotos

import com.google.j2objc.annotations.ObjectiveCName; //导入依赖的package包/类
/**
 * Finding all messages with photos
 *
 * @param peer peer for search
 * @return found messages
 */
@ObjectiveCName("findAllPhotosWithPeer:")
public Command<List<MessageSearchEntity>> findAllPhotos(Peer peer) {
    return callback -> modules.getSearchModule().findAllPhotos(peer)
            .then(v -> callback.onResult(v))
            .failure(e -> callback.onError(e));
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:13,代码来源:Messenger.java


注:本文中的com.google.j2objc.annotations.ObjectiveCName类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。