• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Logger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onBindViewHolder

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    if (mHeaderFooterHelper != null) {
        if (mHeaderFooterHelper.isInHeader(position)
                || mHeaderFooterHelper.isInFooter(position, mItemManager.getItemSize())) {
            /*
             * let head/footer full span in StaggeredGridLayoutManager
             */
            ViewGroup.LayoutParams layoutParams = holder.itemView.getLayoutParams();
            if (layoutParams instanceof StaggeredGridLayoutManager.LayoutParams) {
                ((StaggeredGridLayoutManager.LayoutParams) layoutParams).setFullSpan(true);
            }
            return;
        }
        position -= mHeaderFooterHelper.getHeaderViewSize();
    }
    if (holder instanceof DataBindingViewHolder) {
        if(DEBUG) {
            Logger.i(TAG, "onBindViewHolder", "pos = " + position);
        }
        ((DataBindingViewHolder) holder).onBindData(position, getParameterSupplier());
    }
}
 
开发者ID:LightSun,项目名称:data-mediator,代码行数:24,代码来源:DataBindingRecyclerAdapter.java


示例2: processAddForBinder

import com.heaven7.core.util.Logger; //导入依赖的package包/类
void processAddForBinder(int index ,int addSize){
    //iterate from larger
    for (int size = mBinderMap.size() , i = size - 1; i >= 0; i--) {
        final int key = mBinderMap.keyAt(i);
        if (key < index) {
            continue;
        }
        final Binder<T> val = mBinderMap.valueAt(i);
        //move from key -> key +1
        mBinderMap.put(key + addSize, val);
        if(DEBUG) {
            Logger.d(TAG, "processAddForBinder",
                    String.format("pos from %d to %d", key, key + addSize));
        }
    }
    //for add . the old index of binder already exist. need remove.
    mBinderMap.remove(index);
}
 
开发者ID:LightSun,项目名称:data-mediator,代码行数:19,代码来源:DataBindingRecyclerAdapter.java


示例3: onBindData

import com.heaven7.core.util.Logger; //导入依赖的package包/类
/**
 * called on bind item data.
 *
 * @param position the position (reject headers and footers)
 * @param supplier the supplier, which is used to data-binding. this is from
 *                 {@linkplain DataBindingRecyclerAdapter#onCreateParameterSupplier()}.
 * @see DataBinding
 * @see DataBinding#bind(Object, int, DataBinding.ParameterSupplier, PropertyInterceptor)
 */
@CallSuper
protected void onBindData(int position, @Nullable DataBinding.SimpleParameterSupplier supplier) {
    DataBindingRecyclerAdapter<T> adapter = getAdapter();
    if (adapter == null) {
        return;
    }
    Binder<T> binder = adapter.mBinderMap.get(position);
    if (binder != null) {
        if(DEBUG) {
            Logger.i(TAG, "onBindData", "unbindAll() >>> pos = " + position);
        }
        binder.unbindAll();
    }
    adapter.mBinderMap.put(position, mDataBinding.bindAndApply(
            adapter.getItem(position), 0, supplier, getPropertyInterceptor()));
}
 
开发者ID:LightSun,项目名称:data-mediator,代码行数:26,代码来源:DataBindingRecyclerAdapter.java


示例4: onInit

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
protected void onInit(Context context, Bundle savedInstanceState) {
    mBt_changeProperty.setText("click this to change property");
    mBt_temp.setVisibility(View.GONE);

    //为数据模型创建  中介者。
    mMediator = DataMediatorFactory.createDataMediator(Student.class);
    //添加属性callback
    mMediator.addDataMediatorCallback(new DataMediatorCallback<Student>() {
        @Override
        public void onPropertyValueChanged(Student data, Property prop, Object oldValue, Object newValue) {
            Logger.w("TestPropertyChangeActivity","onPropertyValueChanged","prop = "
                    + prop.getName() + " ,oldValue = " + oldValue + " ,newValue = " + newValue);
            mTv_desc.setText(String.valueOf(newValue));
        }
    });
    mMediator.getDataProxy().setName("heaven7");
}
 
开发者ID:LightSun,项目名称:data-mediator,代码行数:19,代码来源:TestPropertyChangeActivity.java


示例5: onInitialize

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
public void onInitialize(Context context, @Nullable Bundle savedInstanceState) {
    mImageGetter = new ImageHelper(getExternalFilesDir(
            Environment.DIRECTORY_PICTURES).getAbsolutePath(), TestGetImageInN.this, new ImageCallbackImpl()){
    };
    mPermissionHelper.startRequestPermission(
            new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
            new int[]{RC_WRITE_SD},
            new PermissionHelper.ICallback() {
                @Override
                public void onRequestPermissionResult(String requestPermission, int requestCode, boolean success) {
                    if (success) {
                        Logger.i("TestGetImageInN","onRequestPermissionResult","success: " + requestPermission);
                        initImageGetter();
                    }
                }
            });

}
 
开发者ID:LightSun,项目名称:android-util2,代码行数:20,代码来源:TestGetImageInN.java


示例6: act

import com.heaven7.core.util.Logger; //导入依赖的package包/类
/**
 * do act this intent with callback by target actor.
 * @param actor the intent actor
 * @since 1.1.0
 * @return true if act success. if context is recycled or actor verify failed.
 *          this method will return false.
 */
public boolean act(IntentActionActor actor){
    final Context context = getContext();
    if (context != null) {
        if(!actor.verify(context)){
            Logger.w("LauncherIntent","act","act failed. caused by actor.verify() failed.");
            return false;
        }
        IntentActionCallback callback = getCallback();
        final boolean result;
        if(callback != null){
            callback.beforeAction(context, this);
            result = actor.act(context, this);
            callback.afterAction(context, this);
        }else {
            result = actor.act(context, this);
        }
        return result;
    }
    return false;
}
 
开发者ID:LightSun,项目名称:android-util2,代码行数:28,代码来源:LauncherIntent.java


示例7: initData

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
protected void initData(Bundle savedInstanceState) {
    replaceFragment(R.id.fl, FragmentFactory.newFragment(new FragmentHelper(R.layout.frag_component_test,
                    new BundleHelper()
                            .putString("title", "heaven7")
                            .getBundle())
            .setDataBinder(mDataBinder)
    ),false);

    try {
        Field f = Class.forName("sun.misc.Unsafe").getDeclaredField("THE_ONE");
        f.setAccessible(true);
        Object unsafe = f.get(null);
        Logger.i("FragmentComponentTestActivity", "test unsafe: " + unsafe);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:LightSun,项目名称:android-common-util-light,代码行数:19,代码来源:FragmentComponentTestActivity.java


示例8: initData

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
protected void initData(Bundle savedInstanceState) {
    Logger.i(TAG, "onCreate");
    mLoader = new PresenterLoader<>(this, new PresenterMock());
    //自动调用startLoading
    getSupportLoaderManager().initLoader(0, new Bundle(), mLoaderCallback);

    MainWorker.postDelay(2000, new Runnable() {
        @Override
        public void run() {
            Logger.i(TAG, "called by postDelay method");
            // onLoadFinished 被调用的同时,loader也会调用
            mLoader.deliverResult(null);
        }
    });
    MainWorker.postDelay(5000, new Runnable() {
        @Override
        public void run() {
            Logger.i(TAG, "-------------- begin dispatch cancel");
            mLoader.deliverCancellation(); //此方法没有和 loaderManger交互
        }
    });
}
 
开发者ID:LightSun,项目名称:android-common-util-light,代码行数:24,代码来源:LoaderMvpTest.java


示例9: initData

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
protected void initData(Bundle savedInstanceState) {
    getExplicitIntent(this, new Intent(IpcConstant.ACTION_MESSAGE_SERVICE));
    mClient = new MessageClient(this){
        @Override
        protected void afterConnected() {
            showToast("client is connected.");
            Logger.i(TAG, "MessageClient_afterConnected", "client is connected.");
        }
        @Override
        protected void onReceive(Message msg) {
            Logger.i(TAG, "MessageClient_onReceive", toTestString(msg));
        }
        @Override
        protected boolean consumeMessage(Message msg) {
            Logger.i(TAG, "MessageClient_consumeMessage", toTestString(msg));
            return super.consumeMessage(msg);
        }
        @Override
        protected void handleReplyMessage(Message msg) {
            Logger.i(TAG, "MessageClient_handleReplyMessage", toTestString(msg));
        }
    };
}
 
开发者ID:LightSun,项目名称:android-common-util-light,代码行数:25,代码来源:IpcTestActivity.java


示例10: destroyItem

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
    ItemData itemData = (ItemData) object;
    if (dispatchNeedDestroy(position, itemData.data, itemData.fragment)) {
        if (mCurTransaction == null) {
            mCurTransaction = mFragmentManager.beginTransaction();
        }
        if (DEBUG)
            Logger.v(TAG, "Removing item #" + position + ": f=" + object +
                    " v=" + ((Fragment) object).getView());
        mSavedState.put(position, mFragmentManager.saveFragmentInstanceState(itemData.fragment));
        mCurTransaction.remove(itemData.fragment);
        mCache.remove(itemData.data);
    } else {
        container.removeView(itemData.fragment.getView());
    }
}
 
开发者ID:LightSun,项目名称:android-common-util-light,代码行数:18,代码来源:BaseFragmentPagerAdapter.java


示例11: processMessageInMainThread

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
protected boolean processMessageInMainThread(Message msg) {
    final long startTime = (long) msg.obj;
    synchronized (this) {
        if (++mIterationCount == mMaxIterationCount) {
            mIterationCount = mMaxIterationCount;
            mDetached = true;
            return false;
        }
        notifyIntervalTimeChanged();
    }
    final long consumeTime = SystemClock.elapsedRealtime() - startTime;
    if (Debugger.DEBUG) {
        Logger.i(TAG, "processMessageInMainThread", "consumeTime = " + consumeTime);
    }
    mWorkHandler.sendEmptyMessageDelayed(MSG, mCountdownInterval - consumeTime);
    return true;
}
 
开发者ID:LightSun,项目名称:Adapter-CountDownTimer,代码行数:19,代码来源:CountDownManager2.java


示例12: setAdapter

import com.heaven7.core.util.Logger; //导入依赖的package包/类
private void setAdapter() {
    mAdapter = new QuickRecycleViewAdapter<TestBean>(android.R.layout.simple_list_item_1,
            new ArrayList<TestBean>()) {
        @Override
        protected void onBindData(Context context, int position, final TestBean item, int itemLayoutId, final ViewHelper helper) {
            Logger.w(TAG, "onBindData", "position = " + position);
            final TextView tv = helper.getView(android.R.id.text1);
            tv.setText(DF.format(new Date(item.getLeftTime())));
           /*
           mCDM.setCountDownCallback(item,  new CountDownCallbackImpl<TestBean>(position, tv) {
                @Override
                protected CharSequence format(int position, TestBean bean, long millisUntilFinished) {
                    return DF.format(new Date(millisUntilFinished));
                }
            });*/
        }
    };
    //必须在setAdapter之前调用
    mCDM.attach(mAdapter);
    mRv.setAdapter(mAdapter);
}
 
开发者ID:LightSun,项目名称:Adapter-CountDownTimer,代码行数:22,代码来源:ItemCountDownTest.java


示例13: switchMode

import com.heaven7.core.util.Logger; //导入依赖的package包/类
private void switchMode() {
    if(mMode == MODE_FEED){
        mMode = MODE_SUBSCRIBE;
        mLl_indicator.setVisibility(View.GONE);
        mViewPager.setVisibility(View.GONE);
        mVg_subscribe.setVisibility(View.VISIBLE);
      //  mStickyNavLayout.setEnableStickyTouch(false);
        Logger.i(TAG, "switchMode" , "to mode: MODE_SUBSCRIBE");
    }else{
        mMode = MODE_FEED;
        mVg_subscribe.setVisibility(View.GONE);
        mLl_indicator.setVisibility(View.VISIBLE);
        mViewPager.setVisibility(View.VISIBLE);
       // mStickyNavLayout.setEnableStickyTouch(true);
        Logger.i(TAG, "switchMode" , "to mode: MODE_FEED");
    }
}
 
开发者ID:LightSun,项目名称:Android-sticky-navigation-layout,代码行数:18,代码来源:StickyFragment.java


示例14: onScrollStateChanged

import com.heaven7.core.util.Logger; //导入依赖的package包/类
public void onScrollStateChanged(RecyclerView rv, int newState){
     //dragging-> setting->idle  and dragging->idle
     switch (newState){
         case RecyclerView.SCROLL_STATE_DRAGGING:
             Logger.i(TAG, "SCROLL_STATE_DRAGGING");
             break;

         case RecyclerView.SCROLL_STATE_SETTLING:
             Logger.i(TAG, "SCROLL_STATE_SETTLING");
            // final int firstPos = findFirstVisibleItemPosition(rv);
             break;

         case RecyclerView.SCROLL_STATE_IDLE :
             Logger.i(TAG, "SCROLL_STATE_IDLE");
             final int lastPos = RecyclerViewUtils.findLastVisibleItemPosition(rv);
             if(lastPos == RecyclerView.NO_POSITION){
                 Logger.i(TAG, "onScrollStateChanged", "can't find last position of RecyclerView.");
                 return;
             }
             break;
     }
}
 
开发者ID:LightSun,项目名称:Android-sticky-navigation-layout,代码行数:23,代码来源:OnScrollListenerImpl.java


示例15: onMeasure

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);

    if (mEnableStickyTouch && mContentView != null && mIndicator != null) {
        // 设置view的高度 (将mViewPager。的高度设置为  整个 Height - 导航的高度) - 被拦截的child view
        ViewGroup.LayoutParams params = mContentView.getLayoutParams();
        int expect = getMeasuredHeight() - mIndicator.getMeasuredHeight();
        //avoid onMeasure all the time
        if(params.height != expect) {
            params.height = getMeasuredHeight() - mIndicator.getMeasuredHeight();
        }
        if (DEBUG) {
            Logger.i(TAG, "onMeasure", "height = " + params.height + ", snv height = " + getMeasuredHeight());
            Logger.i(TAG, "onMeasure", "---> snv  bottom= " + getBottom());
        }
    }
    mGroupStickyDelegate.afterOnMeasure(this, mTop, mIndicator, mContentView);
}
 
开发者ID:LightSun,项目名称:Android-sticky-navigation-layout,代码行数:20,代码来源:StickyNavigationLayout_medlinker.java


示例16: setScrollState

import com.heaven7.core.util.Logger; //导入依赖的package包/类
/**
 * called when the scroll state change
 *
 * @param expectScrollState the expect state.
 */
private void setScrollState(int expectScrollState) {
    expectScrollState = adjustState(expectScrollState);
    if (mScrollState == expectScrollState) {
        //ignore
        return;
    }
    if (DEBUG) {
        Logger.i(TAG, "setScrollState", "new state = " + getStateString(expectScrollState));
    }
    mScrollState = expectScrollState;

    if (mScrollListener != null) {
        mScrollListener.onScrollStateChange(this, expectScrollState, mFocusDir);
    } else {
        if (getContext() instanceof OnScrollChangeListener) {
            ((OnScrollChangeListener) getContext()).onScrollStateChange(this, expectScrollState, mFocusDir);
        }
    }
}
 
开发者ID:LightSun,项目名称:Android-sticky-navigation-layout,代码行数:25,代码来源:StickyNavigationLayout_backup.java


示例17: dispatchTouchEventToChild

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
public void dispatchTouchEventToChild(StickyNavigationLayout_backup snv, int dx, int dy, MotionEvent event) {
    final RecyclerView view = mWeakRecyclerView.get();
    if (view != null) {
       /* final int position = findFirstVisibleItemPosition(view);
        if (position == -1){
            return;
        }
        final View child = view.getChildAt(position);
        if(child != null && child.getTop() == 0  && dy > 0){
            if(snv.getTopViewState() == VIEW_STATE_SHOW){
                ViewGroup vg = (ViewGroup) view.getParent();
                vg.dispatchTouchEvent(event);
                mParentReceived = true;
                return;
            }
        }*/
        view.scrollBy(0, -dy);
        if(DEBUG){
            Logger.i(TAG, "dispatchTouchEventToChild", "dy = " + dy
                    +" ,can scroll: " + view.getLayoutManager().canScrollVertically());
        }
    }
}
 
开发者ID:LightSun,项目名称:Android-sticky-navigation-layout,代码行数:25,代码来源:StickyNavigationLayout_backup.java


示例18: onNestedScroll

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@Override
public void onNestedScroll(View target, int dxConsumed, int dyConsumed,
                           int dxUnconsumed, int dyUnconsumed){
   /* net
   inal int myConsumed = moveBy(dyUnconsumed);
    final int myUnconsumed = dyUnconsumed - myConsumed;
    dispatchNestedScroll(0, myConsumed, 0, myUnconsumed, null);*/

    // Dispatch up to the nested parent first
    dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed,
            mParentOffsetInWindow);

    // This is a bit of a hack. Nested scrolling works from the bottom up, and as we are
    // sometimes between two nested scrolling views, we need a way to be able to know when any
    // nested scrolling parent has stopped handling events. We do that by using the
    // 'offset in window 'functionality to see if we have been moved from the event.
    // This is a decent indication of whether we should take over the event stream or not.
    final int dy = dyUnconsumed + mParentOffsetInWindow[1];
    Logger.i(TAG, "onNestedScroll", "mTotalUnconsumed = " +   (mTotalUnconsumed + Math.abs(dy))  );
   /* if (dy < 0 && !canChildScrollUp()) {
        mTotalUnconsumed += Math.abs(dy);
      //  moveSpinner(mTotalUnconsumed);
    }*/
}
 
开发者ID:LightSun,项目名称:Android-sticky-navigation-layout,代码行数:25,代码来源:StickyNavigationLayout_backup.java


示例19: onClickAdd

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@OnClick(R.id.bt_add)
public void onClickAdd(View v){
    syso("---------------- start test:  onClickAdd() ---------------->>> ");
    final int index = randomState();
    Logger.i(TAG, "onClickAdd", STATE_STRS[index]);
    getController().addState(STATES[index]);
}
 
开发者ID:LightSun,项目名称:Mvcs,代码行数:8,代码来源:MvcsLogSample.java


示例20: onClickSet

import com.heaven7.core.util.Logger; //导入依赖的package包/类
@OnClick(R.id.bt_set)
public void onClickSet(View v){
    syso("---------------- start test:  onClickSet() ---------------->>> ");
    final int index =  randomState();
    Logger.i(TAG, "onClickSet", STATE_STRS[index]);
    getController().setState(STATES[index]);
}
 
开发者ID:LightSun,项目名称:Mvcs,代码行数:8,代码来源:MvcsLogSample.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LocalizerEventType类代码示例发布时间:2022-05-22
下一篇:
Java IControlContentAdapter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap