Giter Site home page Giter Site logo

Comments (20)

SnowDragon2015 avatar SnowDragon2015 commented on May 5, 2024 5

解决了

from novelreader.

wuzeqiu avatar wuzeqiu commented on May 5, 2024

求指导啊!!咋实现的

from novelreader.

xiaobaDev avatar xiaobaDev commented on May 5, 2024

你是打算拿来搞广告吧?

from novelreader.

xuxh6 avatar xuxh6 commented on May 5, 2024

显示内容位置不够,如何加一页添加自定义view?

from novelreader.

SelfImprLYJ avatar SelfImprLYJ commented on May 5, 2024

解决了

你好,怎么实现的这个然后可以交互啊,求助

from novelreader.

nances avatar nances commented on May 5, 2024

解决了
这个是怎么解决的,谢谢

from novelreader.

wuzeqiu avatar wuzeqiu commented on May 5, 2024

from novelreader.

nances avatar nances commented on May 5, 2024

@wuzeqiu 你是通过Canvas 画了一个空白地方,然后再放个布局在上面的吧

from novelreader.

wuzeqiu avatar wuzeqiu commented on May 5, 2024

from novelreader.

nances avatar nances commented on May 5, 2024

from novelreader.

nances avatar nances commented on May 5, 2024

@wuzeqiu 你这边是怎么设置的,我设置最后一个空白页,但是好像把下一章节的内容第一页的内容给占用了

from novelreader.

wuzeqiu avatar wuzeqiu commented on May 5, 2024

from novelreader.

nances avatar nances commented on May 5, 2024

@wuzeqiu

// TODO: 2018/6/13 绘制插图
Log.v("TAG", "======1 == mCurPage.isAD=======" + mCurPage.isAD);
if (1 == STATUS_CATEGORY_AD) {
Paint.FontMetrics fontMetrics = mTextPaint.getFontMetrics();
float textHeight = fontMetrics.top - fontMetrics.bottom;
float textWidth = mTextPaint.measureText("我要留给一个空白页在这里,你大爷");
float pivotX = (mDisplayWidth - textWidth) / 2;
float pivotY = (mDisplayHeight - textHeight) / 2;
canvas.drawText("", 0, 0, mTextPaint);
STATUS_CATEGORY_AD = 0;
} else {

            //对标题进行绘制
            for (int i = 0; i < mCurPage.titleLines; ++i) {
                str = mCurPage.lines.get(i);

                //设置顶部间距
                if (i == 0) {
                    top += mTitlePara;
                }

                //计算文字显示的起始点
                int start = (int) (mDisplayWidth - mTitlePaint.measureText(str)) / 2;
                //进行绘制
                canvas.drawText(str, start, top, mTitlePaint);

                //设置尾部间距
                if (i == mCurPage.titleLines - 1) {
                    top += titlePara;
                } else {
                    //行间距
                    top += titleInterval;
                }
            }
            //对内容进行绘制
            for (int i = mCurPage.titleLines; i < mCurPage.lines.size(); ++i) {
                str = mCurPage.lines.get(i);
                canvas.drawText(str, mMarginWidth, top, mTextPaint);
                if (str.endsWith("\n")) {
                    top += para;
                } else {
                    top += interval;
                }
            }
            Log.v("TAG", "mCurPage.position" + mCurPage.position);
            if (mCurPage.position + 1 == mCurPageList.size() || (mCurPage.position + 1) == 1) {
                Log.v("TAG", "======绘制插图=======");
                STATUS_CATEGORY_AD = 1;
            }

from novelreader.

wuzeqiu avatar wuzeqiu commented on May 5, 2024

from novelreader.

nances avatar nances commented on May 5, 2024

@wuzeqiu 你邮箱多少,私聊?

from novelreader.

KotlinLan avatar KotlinLan commented on May 5, 2024

https://github.com/itwangyu/NovelReaderAdDemo
这个可以增加自定义布局,但是上下滑动无法点击,大家一起讨论一下能不能解决!

from novelreader.

Airmour avatar Airmour commented on May 5, 2024

@KotlinLan 我也遇到了相同的问题 问题解决了吗

from novelreader.

wuzeqiu avatar wuzeqiu commented on May 5, 2024

from novelreader.

KotlinLan avatar KotlinLan commented on May 5, 2024

@Airmour 没有。

from novelreader.

windouxp avatar windouxp commented on May 5, 2024

https://github.com/itwangyu/NovelReaderAdDemo 这个可以增加自定义布局,但是上下滑动无法点击,大家一起讨论一下能不能解决!

上下滑动可以设置vip,vip免广告 绝了!

from novelreader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.