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


Java Connection.NGWResourceTypeConnection方法代码示例

本文整理汇总了Java中com.nextgis.maplib.datasource.ngw.Connection.NGWResourceTypeConnection方法的典型用法代码示例。如果您正苦于以下问题:Java Connection.NGWResourceTypeConnection方法的具体用法?Java Connection.NGWResourceTypeConnection怎么用?Java Connection.NGWResourceTypeConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.nextgis.maplib.datasource.ngw.Connection的用法示例。


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

示例1: getItem

import com.nextgis.maplib.datasource.ngw.Connection; //导入方法依赖的package包/类
@Override
public Object getItem(int i)
{
    if (null == mCurrentResource || mLoading) {
        return null;
    }

    if (mCurrentResource.getType() == Connection.NGWResourceTypeConnections) {
        if (i > mCurrentResource.getChildrenCount()) {
            return null;
        }
        return mCurrentResource.getChild(i);
    } else if (mCurrentResource.getType() == Connection.NGWResourceTypeConnection) {
        int offset = mShowAccounts ? 1 : 0;
        if (i == 0 && mShowAccounts) {
            return null;
        }
        return mCurrentResource.getChild(i - offset);
    } else if (mCurrentResource.getType() == Connection.NGWResourceTypeResourceGroup) {
        if (i == 0) {
            return null;
        }
        return mCurrentResource.getChild(i - 1);
    }
    return null;
}
 
开发者ID:nextgis,项目名称:android_maplibui,代码行数:27,代码来源:NGWResourcesListAdapter.java

示例2: getView

import com.nextgis.maplib.datasource.ngw.Connection; //导入方法依赖的package包/类
@Override
public View getView(
        int i,
        View view,
        ViewGroup viewGroup)
{
    //show loading view
    if (mLoading) {
        if (isAccountsDisabled())
            return getLoadingView(view);
        else if (i > 0)
            return getLoadingView(view);
    }

    switch (mCurrentResource.getType()) {
        case Connection.NGWResourceTypeConnections:
            final Connection connection = (Connection) getItem(i);
            return getConnectionView(connection, view);
        case Connection.NGWResourceTypeConnection:
        case Connection.NGWResourceTypeResourceGroup:
            Resource resource = (Resource) getItem(i);
            return getResourceView(resource, view);
        default:
            return null;
    }
}
 
开发者ID:nextgis,项目名称:android_maplibui,代码行数:27,代码来源:NGWResourcesListAdapter.java

示例3: onItemClick

import com.nextgis.maplib.datasource.ngw.Connection; //导入方法依赖的package包/类
@Override
public void onItemClick(
        AdapterView<?> adapterView,
        View view,
        int i,
        long l)
{
    if (mCurrentResource.getType() == Connection.NGWResourceTypeConnections) {
        if (i >= mCurrentResource.getChildrenCount()) {
            //start add account activity
            if (mConnectionListener != null)
                mConnectionListener.onAddConnection();
        } else {
            Connection connection = (Connection) mCurrentResource.getChild(i);
            mCurrentResource = connection;

            if (mConnectionListener != null) {
                mConnectionListener.onConnectionSelected(connection);
            } else if (connection.isConnected()) {
                notifyDataSetChanged();
            } else {
                NGWResourceAsyncTask task = new NGWResourceAsyncTask(mContext, connection);
                task.execute();
            }
        }
    } else if (mCurrentResource.getType() == Connection.NGWResourceTypeConnection) {
        if (mShowAccounts) {
            if (i == 0)
                goUp();
            else
                goDeep(i - 1);
        } else
            goDeep(i);
    } else if (mCurrentResource.getType() == Connection.NGWResourceTypeResourceGroup) {
        if (i == 0)
            goUp();
        else
            goDeep(i - 1);
    }
    mPathView.onUpdate(mCurrentResource);
}
 
开发者ID:nextgis,项目名称:android_maplibui,代码行数:42,代码来源:NGWResourcesListAdapter.java


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